aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dst.h
diff options
context:
space:
mode:
authorWei Wang <weiwan@google.com>2017-06-17 10:42:28 -0700
committerDavid S. Miller <davem@davemloft.net>2017-06-17 22:53:59 -0400
commit4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36 (patch)
tree534f9011f830f5cea49311312b19a9f19a9f67f6 /include/net/dst.h
parentnet: introduce DST_NOGC in dst_release() to destroy dst based on refcnt (diff)
downloadlinux-dev-4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36.tar.xz
linux-dev-4a6ce2b6f2ecabbddcfe47e7cf61dd0f00b10e36.zip
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>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r--include/net/dst.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 2735d5a1e774..11d779803c0d 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -428,6 +428,7 @@ void dst_init(struct dst_entry *dst, struct dst_ops *ops,
unsigned short flags);
void __dst_free(struct dst_entry *dst);
struct dst_entry *dst_destroy(struct dst_entry *dst);
+void dst_dev_put(struct dst_entry *dst);
static inline void dst_free(struct dst_entry *dst)
{