route: cannot add/delete a route on 64-bit big endian machines (patch attached)

Seonghun Lim wariua at gmail.com
Sun Sep 21 14:11:38 UTC 2008


Hi,

route applet fails to add/delete a route on 64-bit BE machines with
following message:

bogus netmask 255.255.255.0

The netmask sanity check routine in INET_setroute() stores the value in
an unsigned long variable, whose size is not always 32 bit. Then it is
inverted to yield a value with first 32 bits set to 1. So the testing
condition-- if (mask & (mask + 1)) --is never satisfied, except for
"0.0.0.0".

There're some more routines that use unsigned long to store IPv4
addresses, but they seem to make no problem, so skipped :-)

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-route_netmask_check_fix.patch
Type: text/x-diff
Size: 428 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080921/34860cf3/attachment.bin 


More information about the busybox mailing list