mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 10:31:33 -04:00
netfilter: tproxy: use DEBUG_NET_WARN_ON_ONCE for protocol fallbacks
Replace WARN_ON calls with DEBUG_NET_WARN_ON_ONCE in the default switch blocks of nf_tproxy_get_sock_v4 and v6. Unsupported transport protocols are already safely handled by returning a NULL socket pointer. This prevents unnecessary system panics when panic_on_warn=1 is enabled in production systems. Link: https://patch.msgid.link/cover.1786968834.git.zhilinz@nebusec.ai/ Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
746fc0787f
commit
1f0391aea8
@@ -137,7 +137,7 @@ nf_tproxy_get_sock_v4(struct net *net, struct sk_buff *skb,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
sk = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
DEBUG_NET_WARN_ON_ONCE(1);
|
||||
sk = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user