routing table bug in linux-2.2.0-pre[1-4]

Michael Roth (mroth@nessie.de)
Sun, 3 Jan 1999 21:01:00 -0700 (MST)


Hi,

with the new pre-kernel it is possible to add two equal routing entries
twice to the routing table.

I'm using linux-2.2.0-pre4, ne2000 module, kerneld and net-tools-1.49 but
it looks like that the version of net-tools is _not_ important.

Try the following steps to reproduce the bug:

1.) Make sure that the module `ne' is not used. Shutdown all ethernet
devices and issue a `rmmod ne'.

2.) Use `ifconfig' to bring up the ethernet device. For example:

# ifconfig eth0 192.168.11.12 broadcast 192.168.11.255 \
netmask 255.255.255.0 up

The kernel will add a routing entry automatically (use `route -n'):

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

3.) Now you can add the same route a second time! Try this:

# route add -net 192.168.11.0 netmask 255.255.255.0 eth0

Check out the routing table by using `route -n':

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

As you can see, the network route appears twice. I don't think this
is ok.

Please note: When you try to add the routing entry a third time, you
will get a `SIOCADDRT: File exists' error.

4.) You can remove both routing entries with two equal `route del'
commands:

# route del -net 192.168.11.0 netmask 255.255.255.0 eth0
# route del -net 192.168.11.0 netmask 255.255.255.0 eth0

5.) Once you removed both entries you can _not_ add the two entries
anymore. You can only add one routing entry to the table.

When you try to add the second entry you get a `SIOCADDRT: File
exists' error.

Hopefully this description will help you to find and disable this bug.

cu
Michael

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu