[BusyBox] BusyBox bug (networking/ifupdown.c) with workaround

Antony N Donovan and at MIT.EDU
Thu Feb 5 17:17:29 UTC 2004


Package: busybox
Version: 1.0.0-pre7

There's a small problem processing the /etc/network/interfaces file.
At ifupdown.c:494 in 1.0.0-pre5 (pre7 and pre6, too) the replaceable
string "%bnmask%" is used but, since this functionality is supposed to
behave like it does in Debian, the string used should be "%masklen%".
Using "bnmask" in the interfaces file is the workaround.

So, with this entry in the interfaces file:

iface eth1 inet static
	address 192.168.1.254
	masklen 24
	broadcast 192.168.1.255

# ifup -v 
run-parts /etc/network/if-pre-up.d
ip link set   eth1 up

run-parts /etc/network/if-up.d
# 

and the interface address is not set.

But with this in the interfaces file:

iface eth1 inet static
	address 192.168.1.254
#	masklen 24
	bnmask 24
	broadcast 192.168.1.255

# ifup -v 
run-parts /etc/network/if-pre-up.d
ip addr add 192.168.1.254/24 broadcast 192.168.1.255 dev eth1 label eth1
ip link set eth1 up

run-parts /etc/network/if-up.d
# 

produces the correct result.

The source line (ifupdown.c:494, with changes only in white space):

result =
execute("ip addr add %address%/%bnmask% [[broadcast %broadcast%]] "
"dev %iface% [[peer %pointopoint%]] [[label %label%]]", ifd, exec);

I believe should be:

result =
execute("ip addr add %address%/%masklen% [[broadcast %broadcast%]] "
"dev %iface% [[peer %pointopoint%]] [[label %label%]]", ifd, exec);


I'm using Bering-uClibc version 2.1-rc1, but given the source code,
this would be a problem on any distribution using BusyBox.

I sent an abbreviated description of this directly to Erik Andersen on
February 2. I just realized I should have sent it here in this format.
My apologies to Erik.

Thanks for all the great work,

Antony Donovan

--
My mind is aglow with whirling, transient nodes of thought careening
through a cosmic vapor of invention.
- Hedley Lamarr



More information about the busybox mailing list