lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3,bpf-next] bpf: Don't redirect packets with invalid pkt_len
On Fri, 15 Jul 2022 11:22:33 +0800 Zhengchao Shao wrote:
> +#ifdef CONFIG_DEBUG_NET
> + if (unlikely(!skb->len)) {
> + pr_err("%s\n", __func__);
> + skb_dump(KERN_ERR, skb, false);
> + WARN_ON_ONCE(1);
> + }

Is there a reason to open code WARN_ONCE() like that?

#ifdef CONFIG_DEBUG_NET
if (WARN_ONCE(!skb->len, "%s\n", __func__))
skb_dump(KERN_ERR, skb, false);

or

if (IS_ENABLED(CONFIG_DEBUG_NET) &&
WARN_ONCE(!skb->len, "%s\n", __func__))
skb_dump(KERN_ERR, skb, false);

\
 
 \ /
  Last update: 2022-07-15 06:31    [W:0.701 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site