[Babel-users] Patched version for cost to hop on wireless interfaces

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Thu Nov 5 18:31:16 UTC 2009


> There's no simple fix,

Actually, there is.

                                        Juliusz

diff -rN -u old-babeld/message.c new-babeld/message.c
--- old-babeld/message.c        2009-11-05 19:30:05.000000000 +0100
+++ new-babeld/message.c        2009-11-05 19:30:05.000000000 +0100
@@ -714,15 +714,25 @@
     int add_metric, v4, real_plen, omit = 0;
     const unsigned char *real_prefix;
     unsigned short flags = 0;
+    struct route *route;
 
     if(!net_up(net))
         return;
 
     add_metric = output_filter(id, prefix, plen, net->ifindex);
+
     if(add_metric >= INFINITY)
         return;
 
     metric = MIN(metric + add_metric, INFINITY);
+
+    if(metric < INFINITY) {
+        route = find_installed_route(prefix, plen);
+        if(route && net != route->neigh->network) {
+            metric = MAX(route->refmetric + 1, metric - 128);
+        }
+    }
+
     /* Worst case */
     ensure_space(net, 20 + 12 + 28);




More information about the Babel-users mailing list