diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 42a9e0e..0f254ec 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -467,38 +467,6 @@
     return CMD_SUCCESS;
 }
 
-
-int
-interface_idle(babel_interface_nfo *babel_ifp)
-{
-    return (idle_hello_interval > 0 &&
-            babel_ifp->activity_time < babel_now.tv_sec - idle_time);
-}
-
-int
-update_hello_interval(struct interface *ifp)
-{
-    int rc = 0;
-    unsigned short interval;
-    struct babel_interface *babel_ifp = babel_get_if_nfo(ifp);
-
-    if(interface_idle(babel_ifp))
-        interval = idle_hello_interval;
-    else if(IF_CONF(ifp, hello_interval) > 0)
-        interval = IF_CONF(ifp, hello_interval);
-    else if((ifp->flags & BABEL_IF_WIRED))
-        interval = wired_hello_interval;
-    else
-        interval = wireless_hello_interval;
-
-    if(babel_ifp->hello_interval != interval) {
-        babel_ifp->hello_interval = interval;
-        rc = 1;
-    }
-
-    return rc;
-}
-
 /* This should be no more than half the hello interval, so that hellos
    aren't sent late.  The result is in milliseconds. */
 unsigned
@@ -577,7 +545,6 @@
         babel_ifp->flags |= BABEL_IF_LQ;
     }
 
-    babel_ifp->activity_time = babel_now.tv_sec;
     /* Since the interface was marked as active above, the
      idle_hello_interval cannot be the one being used here. */
     babel_ifp->update_interval = babel_ifp->hello_interval * 4;
@@ -1004,7 +971,6 @@
     /* Here are set the default values for an interface. */
     memset(babel_ifp, 0, sizeof(babel_interface_nfo));
     /* All flags are unset */
-    babel_ifp->activity_time = babel_now.tv_sec;
     babel_ifp->bucket_time = babel_now.tv_sec;
     babel_ifp->bucket = BUCKET_TOKENS_MAX;
     babel_ifp->hello_seqno = (random() & 0xFFFF);
diff --git a/babeld/babel_interface.h b/babeld/babel_interface.h
index ec69bff..579dc04 100644
--- a/babeld/babel_interface.h
+++ b/babeld/babel_interface.h
@@ -71,7 +71,6 @@
     int update_bufsize;
     time_t bucket_time;
     unsigned int bucket;
-    time_t activity_time;
     time_t last_update_time;
     unsigned short hello_seqno;
     unsigned hello_interval;
@@ -142,9 +141,6 @@
 int babel_interface_address_add (int, struct zclient *, zebra_size_t);
 int babel_interface_address_delete (int, struct zclient *, zebra_size_t);
 
-/* others functions */
-int interface_idle(babel_interface_nfo *);
-int update_hello_interval(struct interface *ifp);
 unsigned jitter(babel_interface_nfo *, int);
 unsigned update_jitter(babel_interface_nfo *babel_ifp, int urgent);
 /* return "true" if "address" is one of our ipv6 addresses */
diff --git a/babeld/babel_main.c b/babeld/babel_main.c
index a75171e..f2db0b3 100644
--- a/babeld/babel_main.c
+++ b/babeld/babel_main.c
@@ -79,10 +79,9 @@
 unsigned char myid[8];            /* unique id (mac address of an interface) */
 int debug = BABEL_DEBUG_COMMON;
 
-int idle_time = 320;
-int wireless_hello_interval = -1;
-int wired_hello_interval = -1;
-int idle_hello_interval = -1;
+int default_wireless_hello_interval = -1;
+int default_wired_hello_interval = -1;
+int resend_delay = -1;
 static const char *pidfile = PATH_BABELD_PID;
 
 const unsigned char zeroes[16] = {0};
@@ -259,17 +258,19 @@
     vty_init (master);
     memory_init ();
 
-    /* babeld inits (default options) */
-    /* set default interval's values */
-    if(wireless_hello_interval <= 0)
-        wireless_hello_interval = 4000;
-    wireless_hello_interval = MAX(wireless_hello_interval, 5);
+    if(default_wireless_hello_interval <= 0)
+        default_wireless_hello_interval = 4000;
+    default_wireless_hello_interval = MAX(default_wireless_hello_interval, 5);
 
-    if(wired_hello_interval <= 0)
-        wired_hello_interval = 4000;
-    wired_hello_interval = MAX(wired_hello_interval, 5);
+    if(default_wired_hello_interval <= 0)
+        default_wired_hello_interval = 4000;
+    default_wired_hello_interval = MAX(default_wired_hello_interval, 5);
 
-    /* an assertion */
+    resend_delay = 2000;
+    resend_delay = MIN(resend_delay, default_wireless_hello_interval / 2);
+    resend_delay = MIN(resend_delay, default_wired_hello_interval / 2);
+    resend_delay = MAX(resend_delay, 20);
+
     if(parasitic && allow_duplicates >= 0) {
         /* Too difficult to get right. */
         zlog_err("Sorry, -P and -A are incompatible.");
@@ -561,10 +562,6 @@
             "vty address             = %s%s"
             "vty port                = %d%s"
             "id                      = %s%s"
-            "idle time               = %d%s"
-            "wireless hello interval = %d%s"
-            "wired hello interval    = %d%s"
-            "idle hello interval     = %d%s"
             "parasitic               = %s%s"
             "split-horizon           = %s%s"
             "allow_duplicates        = %s%s"
@@ -580,10 +577,6 @@
             VTY_NEWLINE,
             babel_vty_port, VTY_NEWLINE,
             format_eui64(myid), VTY_NEWLINE,
-            idle_time, VTY_NEWLINE,
-            wireless_hello_interval, VTY_NEWLINE,
-            wired_hello_interval, VTY_NEWLINE,
-            idle_hello_interval, VTY_NEWLINE,
             format_bool(parasitic), VTY_NEWLINE,
             format_bool(split_horizon), VTY_NEWLINE,
             format_bool(allow_duplicates), VTY_NEWLINE,
diff --git a/babeld/babel_main.h b/babeld/babel_main.h
index 2afebc9..4c08e18 100644
--- a/babeld/babel_main.h
+++ b/babeld/babel_main.h
@@ -41,8 +41,8 @@
 extern struct timeval babel_now;         /* current time             */
 extern struct thread_master *master;     /* quagga's threads handler */
 extern int debug;
-extern int wireless_hello_interval, wired_hello_interval, idle_hello_interval;
-extern int idle_time;
+extern int default_wireless_hello_interval, default_wired_hello_interval;
+extern int resend_delay;
 
 extern unsigned char myid[8];
 
diff --git a/babeld/message.c b/babeld/message.c
index 8cd1db6..e86b432 100644
--- a/babeld/message.c
+++ b/babeld/message.c
@@ -282,7 +282,6 @@
             debugf(BABEL_DEBUG_COMMON,"Received hello %d (%d) from %s on %s.",
                    seqno, interval,
                    format_address(from), ifp->name);
-            babel_get_if_nfo(ifp)->activity_time = babel_now.tv_sec;
             changed = update_neighbour(neigh, seqno, interval);
             update_neighbour_metric(neigh, changed);
             if(interval > 0)
@@ -466,7 +465,8 @@
                    update storm.  Ignore a wildcard request that happens
                    shortly after we sent a full update. */
                 if(babel_ifp->last_update_time <
-                   babel_now.tv_sec - MAX(babel_ifp->hello_interval / 100, 1))
+                   (time_t)(babel_now.tv_sec -
+                            MAX(babel_ifp->hello_interval / 100, 1)))
                     send_update(neigh->ifp, 0, NULL, 0);
             } else {
                 send_update(neigh->ifp, 0, prefix, plen);
@@ -755,12 +755,10 @@
 void
 send_hello(struct interface *ifp)
 {
-    int changed;
-    changed = update_hello_interval(ifp);
     babel_interface_nfo *babel_ifp = babel_get_if_nfo(ifp);
     send_hello_noupdate(ifp, (babel_ifp->hello_interval + 9) / 10);
     /* Send full IHU every 3 hellos, and marginal IHU each time */
-    if(changed || babel_ifp->hello_seqno % 3 == 0)
+    if(babel_ifp->hello_seqno % 3 == 0)
         send_ihu(NULL, ifp);
     else
         send_marginal_ihu(ifp);
@@ -1161,13 +1159,11 @@
             buffer_update(ifp, prefix, plen);
         }
     } else {
-        if(!interface_idle(babel_ifp)) {
-            send_self_update(ifp);
-            if(!parasitic) {
-                debugf(BABEL_DEBUG_COMMON,"Sending update to %s for any.",
-                       ifp->name);
-                for_all_installed_routes(buffer_update_callback, ifp);
-            }
+        send_self_update(ifp);
+        if(!parasitic) {
+            debugf(BABEL_DEBUG_COMMON,"Sending update to %s for any.",
+                   ifp->name);
+            for_all_installed_routes(buffer_update_callback, ifp);
         }
         set_timeout(&babel_ifp->update_timeout, babel_ifp->update_interval);
         babel_ifp->last_update_time = babel_now.tv_sec;
@@ -1179,17 +1175,10 @@
 send_update_resend(struct interface *ifp,
                    const unsigned char *prefix, unsigned char plen)
 {
-    int delay;
-
     assert(prefix != NULL);
 
     send_update(ifp, 1, prefix, plen);
-
-    delay = 2000;
-    delay = MIN(delay, wireless_hello_interval / 2);
-    delay = MIN(delay, wired_hello_interval / 2);
-    delay = MAX(delay, 10);
-    record_resend(RESEND_UPDATE, prefix, plen, 0, 0, NULL, delay);
+    record_resend(RESEND_UPDATE, prefix, plen, 0, 0, NULL, resend_delay);
 }
 
 void
@@ -1249,10 +1238,8 @@
         return;
     }
 
-    if(!interface_idle(babel_get_if_nfo(ifp))) {
-        debugf(BABEL_DEBUG_COMMON,"Sending self update to %s.", ifp->name);
-        for_all_xroutes(send_xroute_update_callback, ifp);
-    }
+    debugf(BABEL_DEBUG_COMMON,"Sending self update to %s.", ifp->name);
+    for_all_xroutes(send_xroute_update_callback, ifp);
 }
 
 void
@@ -1501,19 +1488,13 @@
                     const unsigned char *prefix, unsigned char plen,
                     unsigned short seqno, unsigned char *id)
 {
-    int delay;
-
     if(neigh)
         send_unicast_multihop_request(neigh, prefix, plen, seqno, id, 127);
     else
         send_multihop_request(NULL, prefix, plen, seqno, id, 127);
 
-    delay = 2000;
-    delay = MIN(delay, wireless_hello_interval / 2);
-    delay = MIN(delay, wired_hello_interval / 2);
-    delay = MAX(delay, 10);
     record_resend(RESEND_REQUEST, prefix, plen, seqno, id,
-                  neigh ? neigh->ifp : NULL, delay);
+                  neigh ? neigh->ifp : NULL, resend_delay);
 }
 
 void
diff --git a/babeld/resend.c b/babeld/resend.c
index 5a786fc..1cc6290 100644
--- a/babeld/resend.c
+++ b/babeld/resend.c
@@ -123,7 +123,7 @@
         else if(delay)
             resend->delay = delay;
         resend->time = babel_now;
-        resend->max = kind == RESEND_REQUEST ? 128 : UPDATE_MAX;
+        resend->max = RESEND_MAX;
         if(id && memcmp(resend->id, id, 8) == 0 &&
            seqno_compare(resend->seqno, seqno) > 0) {
             return 0;
@@ -140,7 +140,7 @@
         if(resend == NULL)
             return -1;
         resend->kind = kind;
-        resend->max = kind == RESEND_REQUEST ? 128 : UPDATE_MAX;
+        resend->max = RESEND_MAX;
         resend->delay = delay;
         memcpy(resend->prefix, prefix, 16);
         resend->plen = plen;
diff --git a/babeld/resend.h b/babeld/resend.h
index fdb5730..a6755c0 100644
--- a/babeld/resend.h
+++ b/babeld/resend.h
@@ -37,7 +37,7 @@
 */
 
 #define REQUEST_TIMEOUT 65000
-#define UPDATE_MAX 4
+#define RESEND_MAX 3
 
 #define RESEND_REQUEST 1
 #define RESEND_UPDATE 2
diff --git a/babeld/route.c b/babeld/route.c
index a9ffc5d..fe2b9ce 100644
--- a/babeld/route.c
+++ b/babeld/route.c
@@ -682,7 +682,7 @@
     int hold_time = MAX((4 * interval) / 100 + interval / 50, 15);
 
     if(memcmp(router_id, myid, 8) == 0)
-        return NULL; /* I have announced the route */
+        return NULL;
 
     if(martian_prefix(prefix, plen)) {
         zlog_err("Rejecting martian route to %s through %s.",
