BIRD 1.4.0 bugfixes [1/2]

Pierluigi Rolando pierluigi at
Tue Feb 25 00:36:01 CET 2014


This patch fixes a situation where an interface enters TMPDOWN state and doesn't leave it until a device scan is triggered by timer.

This seems to happen whenever the interface is up but with no IP address configured. BIRD will then put the interface in TMPDOWN state (correctly), but the state is not left even though an IP address is assigned later. The problem in turn appears to be the way IF_UPDATE flags are used to pass state information between if_update and ifa_update calls. A scan will make it right, but simply processing RTM messages won't.

A workaround to this issue is to scan devices frequently, which might be not acceptable if reactions to RTM_NEWADDR/RTM_DELADDR/etc. are expected to happen without much average delay.

As you'll see, this patch is probably overkill.


diff -a -u -r a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
--- a/sysdep/linux/netlink.c	2013-11-25 06:19:10.000000000 -0800
+++ b/sysdep/linux/netlink.c	2013-12-05 18:33:09.282768865 -0800
@@ -963,11 +963,24 @@
     case RTM_DELLINK:
       DBG("KRT: Received async link notification (%d)\n", h->nlmsg_type);
       nl_parse_link(h, 0);
+      kif_do_scan(NULL);
     case RTM_NEWADDR:
     case RTM_DELADDR:
       DBG("KRT: Received async address notification (%d)\n", h->nlmsg_type);
+      /* XXX: this (and the one above) are to get unstuck when the if comes up
+       * with no IP address, then a route gets installed, then an IP address
+       * gets configured. The crux of the problem is that async message processing
+       * apparently never gets the interface unstuck from TMPDOWN state,
+       * but the scan will fix it.
+       *
+       * I believe that the problem is that BOTH if_update AND ifa_update must
+       * be called within the same scan (IF_UPDATE flags are relevant).
+       * This will scan ALL interface which is overkill. The parameter (currently
+       * unused) might be used to indicate which one to scan.
+       */
+      kif_do_scan(NULL);
       DBG("KRT: Received unknown async notification (%d)\n", h->nlmsg_type);

More information about the Bird-users mailing list