summaryrefslogtreecommitdiffstats
path: root/include/net/addrconf.h
diff options
context:
space:
mode:
authorStephen Suryaputra <ssuryaextr@gmail.com>2018-04-16 13:42:16 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-17 13:39:51 -0400
commitbdb7cc643fc9db8d6ed9a2b9e524e27ac5882029 (patch)
treea0682f0b12435422ac8699fe2fe29c2a7f5dcd63 /include/net/addrconf.h
parent032234d8231909ac049f22ea3b408487e1c103eb (diff)
downloadlinux-stable-bdb7cc643fc9db8d6ed9a2b9e524e27ac5882029.tar.gz
linux-stable-bdb7cc643fc9db8d6ed9a2b9e524e27ac5882029.tar.bz2
linux-stable-bdb7cc643fc9db8d6ed9a2b9e524e27ac5882029.zip
ipv6: Count interface receive statistics on the ingress netdev
The statistics such as InHdrErrors should be counted on the ingress netdev rather than on the dev from the dst, which is the egress. Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r--include/net/addrconf.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 378d601258be..8312cc25a3af 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -308,6 +308,20 @@ static inline struct inet6_dev *__in6_dev_get(const struct net_device *dev)
}
/**
+ * __in6_dev_get_safely - get inet6_dev pointer from netdevice
+ * @dev: network device
+ *
+ * This is a safer version of __in6_dev_get
+ */
+static inline struct inet6_dev *__in6_dev_get_safely(const struct net_device *dev)
+{
+ if (likely(dev))
+ return rcu_dereference_rtnl(dev->ip6_ptr);
+ else
+ return NULL;
+}
+
+/**
* in6_dev_get - get inet6_dev pointer from netdevice
* @dev: network device
*