• Hangbin Liu's avatar
    net/ipv6: remove the old peer route if change it to a new one · d0098e4c
    Hangbin Liu authored
    When we modify the peer route and changed it to a new one, we should
    remove the old route first. Before the fix:
    
    + ip addr add dev dummy1 2001:db8::1 peer 2001:db8::2
    + ip -6 route show dev dummy1
    2001:db8::1 proto kernel metric 256 pref medium
    2001:db8::2 proto kernel metric 256 pref medium
    + ip addr change dev dummy1 2001:db8::1 peer 2001:db8::3
    + ip -6 route show dev dummy1
    2001:db8::1 proto kernel metric 256 pref medium
    2001:db8::2 proto kernel metric 256 pref medium
    
    After the fix:
    + ip addr change dev dummy1 2001:db8::1 peer 2001:db8::3
    + ip -6 route show dev dummy1
    2001:db8::1 proto kernel metric 256 pref medium
    2001:db8::3 proto kernel metric 256 pref medium
    
    This patch depend on the previous patch "net/ipv6: need update peer route
    when modify metric" to update new peer route after delete old one.
    Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d0098e4c
addrconf.c 173 KB