From: Antonio Pastor <antonio.pastor@gmail.com>
To: netdev@vger.kernel.org, edumazet@google.com
Cc: antonio.pastor@gmail.com, pabeni@redhat.com, horms@kernel.org,
kuba@kernel.org, "David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH net] net: 802: reset skb->transport_header
Date: Fri, 27 Dec 2024 21:12:16 -0500 [thread overview]
Message-ID: <20241228021220.296648-1-antonio.pastor@gmail.com> (raw)
In-Reply-To: <38130786-702c-4089-a518-cba7857448ca@gmail.com>
802.2+LLC+SNAP frames received by napi_complete_done() with GRO and DSA
have skb->transport_header set two bytes short, or pointing 2 bytes
before network_header & skb->data. This was an issue as snap_rcv()
expected offset to point to SNAP header (OID:PID), causing packet to
be dropped.
A fix at llc_fixup_skb() (a024e377efed) resets transport_header,
addressing the issue. This patch is additional clean up to snap_rcv()
so that it resets the offset after pulling the skb instead of
incrementing it to match the pull.
Fixes: fda55eca5a33 ("net: introduce skb_transport_header_was_set()")
Signed-off-by: Antonio Pastor <antonio.pastor@gmail.com>
---
net/802/psnap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/802/psnap.c b/net/802/psnap.c
index fca9d454905f..252006f81afa 100644
--- a/net/802/psnap.c
+++ b/net/802/psnap.c
@@ -58,8 +58,8 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
proto = find_snap_client(skb_transport_header(skb));
if (proto) {
/* Pass the frame on. */
- skb->transport_header += 5;
skb_pull_rcsum(skb, 5);
+ skb_reset_transport_header(skb);
rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);
}
rcu_read_unlock();
--
2.43.0
next prev parent reply other threads:[~2024-12-28 2:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241220142020.1131017-1-antonio.pastor@gmail.com>
2024-12-23 13:39 ` [PATCH net v2] net: llc: explicitly set skb->transport_header Antonio Pastor
2024-12-23 13:54 ` Eric Dumazet
[not found] ` <c8145fd0-df13-4c6a-8678-fbf9547cc112@gmail.com>
2024-12-23 18:18 ` Eric Dumazet
2024-12-25 1:35 ` Antonio Pastor
2024-12-28 2:12 ` Antonio Pastor [this message]
2024-12-30 8:26 ` [PATCH net] net: 802: reset skb->transport_header Eric Dumazet
2025-01-03 0:18 ` Antonio Pastor
2025-01-03 1:23 ` [PATCH net v2] net: 802: LLC+SNAP OID:PID lookup on start of skb data Antonio Pastor
2025-01-03 8:46 ` Eric Dumazet
2025-01-04 16:20 ` patchwork-bot+netdevbpf
2024-12-25 1:07 ` [PATCH net v3] net: llc: reset skb->transport_header Antonio Pastor
2024-12-26 9:38 ` Eric Dumazet
2024-12-27 19:30 ` patchwork-bot+netdevbpf
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=20241228021220.296648-1-antonio.pastor@gmail.com \
--to=antonio.pastor@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