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:
Fernando Fernandez Mancera
2026-06-01 21:30:46 +02:00
committed by Pablo Neira Ayuso
parent 746fc0787f
commit 1f0391aea8
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;
}