diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2021-11-23 05:54:30 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-23 14:51:37 +0300 |
commit | 1e84dc6b7bbfc4d1dd846decece4611b7e035772 (patch) | |
tree | 08827418ecf758dd90a2f8cf6b0515e5bf0f07ec /include/net/ndisc.h | |
parent | a0c2ccd9b5ad0a9e838158404e041b5a8ff762dd (diff) | |
download | linux-1e84dc6b7bbfc4d1dd846decece4611b7e035772.tar.xz |
neigh: introduce neigh_confirm() helper function
Add neigh_confirm() for the confirmed member in struct neighbour,
it can be called as an independent unit by other functions.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ndisc.h')
-rw-r--r-- | include/net/ndisc.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 04341d86585d..53cb8de0e589 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -411,13 +411,7 @@ static inline void __ipv6_confirm_neigh(struct net_device *dev, rcu_read_lock_bh(); n = __ipv6_neigh_lookup_noref(dev, pkey); - if (n) { - unsigned long now = jiffies; - - /* avoid dirtying neighbour */ - if (READ_ONCE(n->confirmed) != now) - WRITE_ONCE(n->confirmed, now); - } + neigh_confirm(n); rcu_read_unlock_bh(); } @@ -428,13 +422,7 @@ static inline void __ipv6_confirm_neigh_stub(struct net_device *dev, rcu_read_lock_bh(); n = __ipv6_neigh_lookup_noref_stub(dev, pkey); - if (n) { - unsigned long now = jiffies; - - /* avoid dirtying neighbour */ - if (READ_ONCE(n->confirmed) != now) - WRITE_ONCE(n->confirmed, now); - } + neigh_confirm(n); rcu_read_unlock_bh(); } |