Netdev List
 help / color / mirror / Atom feed
From: Aravind Krishna <aravindkrishhna@gmail.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, pabeni@redhat.com, edumazet@google.com,
	horms@kernel.org, davem@davemloft.net,
	linux-kernel@vger.kernel.org,
	Aravind Krishna <aravindkrishhna@gmail.com>
Subject: [PATCH] hsr: prp: honor master promisc mode for local delivery with macvlan
Date: Wed, 22 Jul 2026 09:46:29 +0530	[thread overview]
Message-ID: <20260722041629.657330-1-aravindkrishhna@gmail.com> (raw)

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 <aravindkrishhna@gmail.com>
---
 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


                 reply	other threads:[~2026-07-22  4:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260722041629.657330-1-aravindkrishhna@gmail.com \
    --to=aravindkrishhna@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox