[Babel-users] [PATCH] Ignore IPv6 routing cache on linux

Baptiste Jonglez baptiste.jonglez at ens-lyon.fr
Wed Apr 24 09:31:10 UTC 2013


Recent linux kernels (roughly 3.x) keep a routing cache for IPv6: each
time a host is contacted, a temporary /128 route is added. These
routes are visible using “ip -6 route show cache”.

Asking babeld to redistribute all IPv6 routes known to the host, using
"redistribute ip ::/0", causes it to announce and de-announce these
/128 routes frequently, leading other nodes to mark them as
unreachable (thus preventing communication with the host described by
the /128 route, even though less specific routes are available).
---
 kernel_netlink.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel_netlink.c b/kernel_netlink.c
index 0a85009..fc6519b 100644
--- a/kernel_netlink.c
+++ b/kernel_netlink.c
@@ -1106,6 +1106,10 @@ filter_kernel_routes(struct nlmsghdr *nh, void *data)
     if(rtm->rtm_src_len != 0)
         return 0;
 
+    /* Ignore cached routes, advertised by some kernels (linux 3.x). */
+    if(rtm->rtm_flags & RTM_F_CLONED)
+      return 0;
+
     if(data)
         current_route = &routes[*found];
     else
-- 
1.8.2.1




More information about the Babel-users mailing list