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

Benjamin Henrion bh at udev.org
Fri Nov 6 09:34:39 UTC 2009


On Thu, Nov 5, 2009 at 7:31 PM, Juliusz Chroboczek
<Juliusz.Chroboczek at pps.jussieu.fr> wrote:
>> 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);

Should I recompile it? You will put it in the next release as an option?

-- 
Benjamin Henrion <bhenrion at ffii.org>
FFII Brussels - +32-484-566109 - +32-2-4148403
"In July 2005, after several failed attempts to legalise software
patents in Europe, the patent establishment changed its strategy.
Instead of explicitly seeking to sanction the patentability of
software, they are now seeking to create a central European patent
court, which would establish and enforce patentability rules in their
favor, without any possibility of correction by competing courts or
democratically elected legislators."



More information about the Babel-users mailing list