Thread (2 messages) 2 messages, 2 authors, 4d ago
COOLING4d

[PATCH] hsr: prp: honor master promisc mode for local delivery with macvlan

From: Aravind Krishna <hidden>
Date: 2026-07-22 04:17:15
Also in: lkml
Subsystem: hsr network protocol, networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

When running MACVLAN over PRP, packets can be expected to be delivered
to the local stack when the PRP/HSR master is in promiscuous mode.

Update local destination handling in check_local_dest() so that if the
master device exists and has IFF_PROMISC set, the packet is marked
PACKET_HOST and treated as local destination.

This enables expected receive behavior for MACVLAN over PRP setups.

Signed-off-by: Aravind-kris <redacted>
---
 net/hsr/hsr_forward.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 0774981a65c1..38ed6b09fc4a 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -589,6 +589,8 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
 static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
 			     struct hsr_frame_info *frame)
 {
+	struct hsr_port *master;
+
 	if (hsr_addr_is_self(hsr, eth_hdr(skb)->h_dest)) {
 		frame->is_local_exclusive = true;
 		skb->pkt_type = PACKET_HOST;
@@ -600,8 +602,24 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
 	    skb->pkt_type == PACKET_MULTICAST ||
 	    skb->pkt_type == PACKET_BROADCAST) {
 		frame->is_local_dest = true;
-	} else {
-		frame->is_local_dest = false;
+	}
+	else
+	{
+		master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
+
+		if (!master || !master->dev)
+		{
+        		frame->is_local_dest = false;
+		}
+		else if (master->dev->flags & IFF_PROMISC)
+		{
+        		skb->pkt_type = PACKET_HOST;
+        		frame->is_local_dest = true;
+		}
+		else
+		{
+			frame->is_local_dest = false;
+		}
 	}
 }
 
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help