[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220512091558.350899ff@kernel.org>
Date: Thu, 12 May 2022 09:15:58 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: menglong8.dong@...il.com
Cc: nhorman@...driver.com, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, yoshfuji@...ux-ipv6.org, dsahern@...nel.org,
imagedong@...cent.com, kafai@...com, talalahmad@...gle.com,
keescook@...omium.org, asml.silence@...il.com, willemb@...gle.com,
vasily.averin@...ux.dev, ilias.apalodimas@...aro.org,
luiz.von.dentz@...el.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/4] net: skb: check the boundrary of drop
reason in kfree_skb_reason()
On Thu, 12 May 2022 20:33:11 +0800 menglong8.dong@...il.com wrote:
> + if (unlikely(reason <= 0 || reason >= SKB_DROP_REASON_MAX)) {
> + DEBUG_NET_WARN_ON_ONCE(1);
> + reason = SKB_DROP_REASON_NOT_SPECIFIED;
> + }
With drop_monitor fixes sending an invalid reason to the tracepoint
should be a minor bug, right?
Can we just have a:
DEBUG_NET_WARN_ON_ONCE(reason <= 0 || reason >= SKB_DROP_REASON_MAX);
and avoid having this branch on non-debug builds?
Powered by blists - more mailing lists