• Wei Wang's avatar
    net: introduce a new function dst_dev_put() · 4a6ce2b6
    Wei Wang authored
    This function should be called when removing routes from fib tree after
    the dst gc is no longer in use.
    We first mark DST_OBSOLETE_DEAD on this dst to make sure next
    dst_ops->check() fails and returns NULL.
    Secondly, as we no longer keep the gc_list, we need to properly
    release dst->dev right at the moment when the dst is removed from
    the fib/fib6 tree.
    It does the following:
    1. change dst->input and output pointers to dst_discard/dst_dscard_out to
       discard all packets
    2. replace dst->dev with loopback interface
    Signed-off-by: default avatarWei Wang <weiwan@google.com>
    Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4a6ce2b6
dst.c 13.5 KB