]> git.hungrycats.org Git - linux/commit
[IPV6]: Fix hangs during interface down caused by ipv6_del_addr().
authorKrishna Kumar <krkumar@us.ibm.com>
Sat, 8 Nov 2003 14:33:05 +0000 (06:33 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Sat, 8 Nov 2003 14:33:05 +0000 (06:33 -0800)
commit4a32b9e7c097b1323131a182ddf4ff5e9b3d5e89
treeef04655e46ab6435e4633afa67c51f2e6ee7084e
parent9409365954c8257beec11fb8909a1789160ac534
[IPV6]: Fix hangs during interface down caused by ipv6_del_addr().

While using PRIVACY extensions, I sometimes get a hang when I remove the
interface. But I can reproduce this every time using the test script at
the end of the mail (hang depends on the order of address deletion).

The bug is in ipv6_del_addr() where if a temp address is being deleted, it
does an __in6_ifa_put() of the main address from which it was derived
(basically the autoconf prefix address). So if the main address was
deleted first, it's ifp ref count would be 1 and it would 'wait' to be
freed till it's temp address was freed first. When the temp address is
deleted, the __put() routine drops the main address's ifp ref count to 0,
but not free it. unregister_netdevice() hangs giving message that ref
count is 1. Fix tested overnight.

Also, the code at the top of the routine is unnecessary, the same is being
done when the address is found a little later in that routine.
net/ipv6/addrconf.c