summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorStephen Suryaputra2018-04-16 19:42:16 +0200
committerDavid S. Miller2018-04-17 19:39:51 +0200
commitbdb7cc643fc9db8d6ed9a2b9e524e27ac5882029 (patch)
treea0682f0b12435422ac8699fe2fe29c2a7f5dcd63 /net/netfilter
parentnet/ipv6: Make __inet6_bind static (diff)
downloadkernel-qcow2-linux-bdb7cc643fc9db8d6ed9a2b9e524e27ac5882029.tar.gz
kernel-qcow2-linux-bdb7cc643fc9db8d6ed9a2b9e524e27ac5882029.tar.xz
kernel-qcow2-linux-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 'net/netfilter')
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 4527921b1c3a..ba0a0fd045c8 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -266,12 +266,13 @@ static inline bool decrement_ttl(struct netns_ipvs *ipvs,
/* check and decrement ttl */
if (ipv6_hdr(skb)->hop_limit <= 1) {
+ struct inet6_dev *idev = __in6_dev_get_safely(skb->dev);
+
/* Force OUTPUT device used as source address */
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_TIME_EXCEED,
ICMPV6_EXC_HOPLIMIT, 0);
- __IP6_INC_STATS(net, ip6_dst_idev(dst),
- IPSTATS_MIB_INHDRERRORS);
+ __IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
return false;
}