From: Robert Hodaszi <robert.hodaszi@digi.com>
To: hodrob84@gmail.com
Cc: Robert Hodaszi <robert.hodaszi@digi.com>, stable@vger.kernel.org
Subject: [PATCH] net: dsa: tag_ocelot_8021q: fix broken reception
Date: Wed, 11 Dec 2024 15:24:02 +0100 [thread overview]
Message-ID: <20241211142402.1406779-1-robert.hodaszi@digi.com> (raw)
Commit dcfe7673787b4bfea2c213df443d312aa754757b ("net: dsa: tag_sja1105:
absorb logic for not overwriting precise info into dsa_8021q_rcv()")
added support to let the DSA switch driver set source_port and
switch_id. tag_8021q's logic overrides the previously set source_port
and switch_id only if they are marked as "invalid" (-1). sja1105 and
vsc73xx drivers are doing that properly, but ocelot_8021q driver doesn't
initialize those variables. That causes dsa_8021q_rcv() doesn't set
them, and they remain unassigned.
Initialize them as invalid to so dsa_8021q_rcv() can return with the
proper values.
Signed-off-by: Robert Hodaszi <robert.hodaszi@digi.com>
Cc: stable@vger.kernel.org
---
net/dsa/tag_ocelot_8021q.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dsa/tag_ocelot_8021q.c b/net/dsa/tag_ocelot_8021q.c
index 8e8b1bef6af6..11ea8cfd6266 100644
--- a/net/dsa/tag_ocelot_8021q.c
+++ b/net/dsa/tag_ocelot_8021q.c
@@ -79,7 +79,7 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb,
static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
struct net_device *netdev)
{
- int src_port, switch_id;
+ int src_port = -1, switch_id = -1;
dsa_8021q_rcv(skb, &src_port, &switch_id, NULL, NULL);
--
2.43.0
next reply other threads:[~2024-12-11 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 14:24 Robert Hodaszi [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-11 12:46 [PATCH] net: dsa: tag_ocelot_8021q: fix broken reception Robert Hodaszi
2024-12-11 13:34 ` Andrew Lunn
2024-12-11 14:21 ` Robert Hodaszi
2024-12-11 14:37 ` Vladimir Oltean
2024-12-11 14:42 ` Robert Hodaszi
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=20241211142402.1406779-1-robert.hodaszi@digi.com \
--to=robert.hodaszi@digi.com \
--cc=hodrob84@gmail.com \
--cc=stable@vger.kernel.org \
/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