• Ido Schimmel's avatar
    ipv6: Regenerate host route according to node pointer upon loopback up · 9217d8c2
    Ido Schimmel authored
    When the loopback device is brought back up we need to check if the host
    route attached to the address is still in the FIB and regenerate one in
    case it's not.
    
    Host routes using the loopback device are always inserted into and
    removed from the FIB under RTNL (under which this function is called),
    so we can test their node pointer instead of the reference count in
    order to check if the route is in the FIB or not.
    
    Tested using the following script from Nicolas mentioned in
    commit a220445f ("ipv6: correctly add local routes when lo goes up"):
    
    $ ip link add dummy1 type dummy
    $ ip link set dummy1 up
    $ ip link set lo down ; ip link set lo up
    
    The host route is correctly regenerated.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9217d8c2
addrconf.c 160 KB