ipv6: bump genid when delete/add address
authorfan.du <fan.du@windriver.com>
Thu, 1 Aug 2013 09:44:44 +0000 (17:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2013 23:33:32 +0000 (16:33 -0700)
commit439677d766ba9095e5afc4a30147f65bc363b6e7
tree61c976d20b54e9de16f51b62d569e450f5f14661
parentc1fc20aa16b3d0c52d88fffb3eca6981f3f82ca7
ipv6: bump genid when delete/add address

Server           Client
2001:1::803/64  <-> 2001:1::805/64
2001:2::804/64  <-> 2001:2::806/64

Server side fib binary tree looks like this:

                                   (2001:/64)
                                   /
                                  /
                   ffff88002103c380
                 /                 \
     (2)        /                   \
 (2001::803/128)                     ffff880037ac07c0
                                    /               \
                                   /                 \  (3)
                      ffff880037ac0640               (2001::806/128)
                       /             \
             (1)      /               \
        (2001::804/128)               (2001::805/128)

Delete 2001::804/64 won't cause prefix route deleted as well as rt in (3)
destinate to 2001::806 with source address as 2001::804/64. That's because
2001::803/64 is still alive, which make onlink=1 in ipv6_del_addr, this is
where the substantial difference between same prefix configuration and
different prefix configuration :) So packet are still transmitted out to
2001::806 with source address as 2001::804/64.

So bump genid will clear rt in (3), and up layer protocol will eventually
find the right one for themselves.

This problem arised from the discussion in here:
http://marc.info/?l=linux-netdev&m=137404469219410&w=4

Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c