Bug in bb 1.5.0 ifupdown applet

Nathan Angelacos nangel at nothome.org
Tue May 1 00:27:24 UTC 2007


Hello,

The ifupdown applet in 1.5.0 appears to have a bug that was not present
in 1.4.1.  The bug is that /var/run/ifstate is not updated with all
interfaces if an interface stanza calls ifup statement to bring up a
second interface.

Given the following interfaces file:

iface lo inet static
    address 127.0.0.1
    netmask 255.0.0.0
    up ifup tunl
    down ifdown tunl

iface tunl inet manual
    up modprobe ipip || true
    up ip tun add tunl mode ipip local 127.0.0.1 remote 192.168.0.1
    up ip link set tunl up
    down ip link set tunl down
    down ip tunl del


"ifup lo" correctly brings up lo and the tunl interface.  However,
 /var/run/ifstate only lists "lo=lo".

An strace for "ifup lo" shows:

1. the "parent" ifup reads /var/run/ifstate
2. the "parent" forks to run the child ifup
2. the "child" ifup reads /var/run/ifstate
3. the "child" writes its interface to /var/run/ifstate
4. the "child" exits
5. the "parent" writes its interface to /var/run/ifstate, using the info
from step 1

That is, the parent does not re-read ifstate before writing.

Its not a simple case of re-reading /var/run/ifstate, since the code
between the read (line 1122) and write (line 1262) could itself update
the linked list.





More information about the busybox mailing list