[PATCH net-next 14/14] ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2()
From: Dmitry Skorodumov
Date: Wed Nov 05 2025 - 11:15:09 EST
Packets with pkt_type == PACKET_LOOPBACK are captured by
handle_frame() function, but they don't have L2 header.
We should not process them in handle_mode_l2().
This doesn't affect old L2 functionality, since handling
was anyway incorrect.
Handle them the same way as in br_handle_frame():
just pass the skb.
To observe invalid behaviour, just start "ping -b" on bcast address
of port-interface.
Signed-off-by: Dmitry Skorodumov <skorodumov.dmitry@xxxxxxxxxx>
---
drivers/net/ipvlan/ipvlan_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index b38ce991e832..cb89fb7213c9 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -1134,6 +1134,9 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
rx_handler_result_t ret = RX_HANDLER_PASS;
bool need_eth_fix;
+ if (unlikely(skb->pkt_type == PACKET_LOOPBACK))
+ return RX_HANDLER_PASS;
+
/* Ignore already seen packets. */
if (ipvlan_is_skb_marked(skb, port->dev))
return RX_HANDLER_PASS;
--
2.25.1