[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220125150132.3f4291fa@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
Date: Tue, 25 Jan 2022 15:01:32 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Jeffrey Ji <jeffreyjilinux@...il.com>
Cc: Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Brian Vazquez <brianvv@...gle.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
jeffreyji <jeffreyji@...gle.com>
Subject: Re: [PATCH v2 net-next] net-core: add InMacErrors counter
On Tue, 25 Jan 2022 19:07:17 +0000 Jeffrey Ji wrote:
> From: jeffreyji <jeffreyji@...gle.com>
>
> Increment InMacErrors counter when packet dropped due to incorrect dest
> MAC addr.
>
> An example when this drop can occur is when manually crafting raw
> packets that will be consumed by a user space application via a tap
> device. For testing purposes local traffic was generated using trafgen
> for the client and netcat to start a server
>
> example output from nstat:
> \~# nstat -a | grep InMac
> Ip6InMacErrors 0 0.0
> IpExtInMacErrors 1 0.0
>
> Tested: Created 2 netns, sent 1 packet using trafgen from 1 to the other
> with "{eth(daddr=$INCORRECT_MAC...}", verified that nstat showed the
> counter was incremented.
> diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
> index 80256717868e..2903869274ca 100644
> --- a/net/ipv6/ip6_input.c
> +++ b/net/ipv6/ip6_input.c
> @@ -150,6 +150,7 @@ static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev,
> struct inet6_dev *idev;
>
> if (skb->pkt_type == PACKET_OTHERHOST) {
> + __IP6_INC_STATS(net, idev, IPSTATS_MIB_INMACERRORS);
Clang points out idev is not initialized at this point, yet.
Powered by blists - more mailing lists