Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: arcnet: fix packet length calculations in capmode/rfc1051/rfc1201
@ 2026-12-05 22:02 Ethan Nelson-Moore
  2026-12-05 22:08 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: Ethan Nelson-Moore @ 2026-12-05 22:02 UTC (permalink / raw)
  To: netdev
  Cc: Ethan Nelson-Moore, stable, Michael Grzeschik, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni

Two off-by-one bugs in packet length calculations were fixed in
arc-rawmode.c by commit 52edc17f94f7 ("bugfixes and new hardware
support for arcnet driver").

From its commit message:

      rx():
      - Fixed error in received packet lengths; 256 byte packets were
        being received as 257 bytes packets.

      prepare_tx():
      - Fixed error in transmit length calcs; 257 byte packets were being
        transmitted as 260 byte packets.

However, these fixes were never applied to the other protocol drivers.
Do so.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
 drivers/net/arcnet/capmode.c | 4 ++--
 drivers/net/arcnet/rfc1051.c | 4 ++--
 drivers/net/arcnet/rfc1201.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 7a0a79973769..b566313dc87e 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -51,7 +51,7 @@ static void rx(struct net_device *dev, int bufnum,
 	arc_printk(D_DURING, dev, "it's a raw(cap) packet (length=%d)\n",
 		   length);
 
-	if (length >= MinTU)
+	if (length > MTU)
 		ofs = 512 - length;
 	else
 		ofs = 256 - length;
@@ -153,7 +153,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 			   length, XMTU);
 		length = XMTU;
 	}
-	if (length > MinTU) {
+	if (length >= MinTU) {
 		hard->offset[0] = 0;
 		hard->offset[1] = ofs = 512 - length;
 	} else if (length > MTU) {
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index 46519ca63a0a..b8e558366682 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -129,7 +129,7 @@ static void rx(struct net_device *dev, int bufnum,
 
 	arc_printk(D_DURING, dev, "it's a raw packet (length=%d)\n", length);
 
-	if (length >= MinTU)
+	if (length > MTU)
 		ofs = 512 - length;
 	else
 		ofs = 256 - length;
@@ -224,7 +224,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 			   length, XMTU);
 		length = XMTU;
 	}
-	if (length > MinTU) {
+	if (length >= MinTU) {
 		hard->offset[0] = 0;
 		hard->offset[1] = ofs = 512 - length;
 	} else if (length > MTU) {
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index f2ec58d06fc3..f8c0d7e125ee 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -143,7 +143,7 @@ static void rx(struct net_device *dev, int bufnum,
 	arc_printk(D_DURING, dev, "it's an RFC1201 packet (length=%d)\n",
 		   length);
 
-	if (length >= MinTU)
+	if (length > MTU)
 		ofs = 512 - length;
 	else
 		ofs = 256 - length;
@@ -448,7 +448,7 @@ static void load_pkt(struct net_device *dev, struct arc_hardware *hard,
 
 	/* assume length <= XMTU: someone should have handled that by now. */
 
-	if (softlen > MinTU) {
+	if (softlen >= MinTU) {
 		hard->offset[0] = 0;
 		hard->offset[1] = ofs = 512 - softlen;
 	} else if (softlen > MTU) {	/* exception packet - add an extra header */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: arcnet: fix packet length calculations in capmode/rfc1051/rfc1201
  2026-12-05 22:02 [PATCH] net: arcnet: fix packet length calculations in capmode/rfc1051/rfc1201 Ethan Nelson-Moore
@ 2026-12-05 22:08 ` netdev-bot+sinfo
  0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-12-05 22:08 UTC (permalink / raw)
  To: Ethan Nelson-Moore
  Cc: netdev, stable, Michael Grzeschik, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-05 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 22:02 [PATCH] net: arcnet: fix packet length calculations in capmode/rfc1051/rfc1201 Ethan Nelson-Moore
2026-12-05 22:08 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox