[IPV6]: Don't hold extra ref count in ipv6_ifa_notify
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Feb 2006 00:55:45 +0000 (16:55 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Feb 2006 00:55:45 +0000 (16:55 -0800)
commit4641e7a334adf6856300a98e7296dfc886c446af
tree39030c280f6fbfa183c2ce5a0db37118ce5a7810
parent42c5e15f18d63c1ecf79d52bdaf4ea31cd22416d
[IPV6]: Don't hold extra ref count in ipv6_ifa_notify

Currently the logic in ipv6_ifa_notify is to hold an extra reference
count for addrconf dst's that get added to the routing table.  Thus,
when addrconf dst entries are taken out of the routing table, we need
to drop that dst.  However, addrconf dst entries may be removed from
the routing table by means other than __ipv6_ifa_notify.

So we're faced with the choice of either fixing up all places where
addrconf dst entries are removed, or dropping the extra reference count
altogether.

I chose the latter because the ifp itself always holds a dst reference
count of 1 while it's alive.  This is dropped just before we kfree the
ifp object.  Therefore we know that in __ipv6_ifa_notify we will always
hold that count.

This bug was found by Eric W. Biederman.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c