net: remove WARN_ON_ONCE() from sk_mc_loop()
Subsystems (3)
PATCH 1/1 net: remove WARN_ON_ONCE() from sk_mc_loop()
sk_mc_loop() can be called for sockets that are neither AF_INET nor AF_INET6 (e.g. AF_PACKET sockets when sending packets via raw/packet socket over virtual devices such as VRF or ipvlan).
In such cases, sk_family is not AF_INET/AF_INET6 and sk_mc_loop() falls through the switch statement and triggers WARN_ON_ONCE(1).
Non-INET sockets do not support IP_MULTICAST_LOOP or IPV6_MULTICAST_LOOP options, so loopback should default to true without generating a warning.
--- net/core/sock.c | 1 - 1 file changed, 1 deletion(-)
net/core/sock.c +0 -1
@@ -779,7 +779,6 @@ bool sk_mc_loop(const struct sock *sk)return inet6_test_bit (MC6_LOOP , sk);#endif } -WARN_ON_ONCE (1 );return true; }EXPORT_SYMBOL (sk_mc_loop);
Signature · 1 line
2.55.0.571.g244d577d93-goog
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Tue, 4 Aug 2026 15:20:48 +0000 you wrote:
sk_mc_loop()can be called for sockets that are neitherAF_INETnorAF_INET6(e.g.AF_PACKETsockets when sending packets via raw/packet socket over virtual devices such as VRF or ipvlan).In such cases,
sk_familyis not AF_INET/AF_INET6 andsk_mc_loop()falls through the switch statement and triggersWARN_ON_ONCE(1).[...]
Here is the summary with links:
- [net] net: remove WARN_ON_ONCE() from sk_mc_loop()
https://git.kernel.org/netdev/net/c/b8a39a09ae4e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html