]> git.baikalelectronics.ru Git - kernel.git/commit
net: introduce a new function dst_dev_put()
authorWei Wang <weiwan@google.com>
Sat, 17 Jun 2017 17:42:28 +0000 (10:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Jun 2017 02:53:59 +0000 (22:53 -0400)
commitd5e418a72b411e9aef1e111327591ab549fef3b8
tree534f9011f830f5cea49311312b19a9f19a9f67f6
parent29c3f49c7d85ad81608b7de713fadb8122945f02
net: introduce a new function dst_dev_put()

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: Wei Wang <weiwan@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dst.h
net/core/dst.c