LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARCNET: fix hard_header_len limit
@ 2015-07-30 13:34 Michael Grzeschik
  2015-07-30 18:16 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Grzeschik @ 2015-07-30 13:34 UTC (permalink / raw
  To: davem; +Cc: netdev, linux-kernel, kernel

The commit <9c7077622dd9> ("packet: make packet_snd fail on len smaller
than l2 header") adds the check for minimum packet length of the used l2.
For arcnet the hardware header length is not the complete archdr which
includes hard + soft header. This patch changes the length to
sizeof(arc_hardware).

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/arcnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 10f71c73..816d0e9 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -326,7 +326,7 @@ static void arcdev_setup(struct net_device *dev)
 	dev->type = ARPHRD_ARCNET;
 	dev->netdev_ops = &arcnet_netdev_ops;
 	dev->header_ops = &arcnet_header_ops;
-	dev->hard_header_len = sizeof(struct archdr);
+	dev->hard_header_len = sizeof(struct arc_hardware);
 	dev->mtu = choose_mtu();
 
 	dev->addr_len = ARCNET_ALEN;
-- 
2.1.4


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

* Re: [PATCH] ARCNET: fix hard_header_len limit
  2015-07-30 13:34 Michael Grzeschik
@ 2015-07-30 18:16 ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-07-30 18:16 UTC (permalink / raw
  To: m.grzeschik; +Cc: netdev, linux-kernel, kernel

From: Michael Grzeschik <m.grzeschik@pengutronix.de>
Date: Thu, 30 Jul 2015 15:34:36 +0200

> The commit <9c7077622dd9> ("packet: make packet_snd fail on len smaller
> than l2 header") adds the check for minimum packet length of the used l2.
> For arcnet the hardware header length is not the complete archdr which
> includes hard + soft header. This patch changes the length to
> sizeof(arc_hardware).
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

The hard header len is used for other purposes as well, are you sure
those don't get broken by this change?

Code assumes that if the data at the SKB mac pointer is taken, for
dev->hard_header_len bytes, that is exactly the link layer header.
And that this can be used to compare two MAC headers, copy the
MAC header from one packet to another, etc.

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

* Re: [PATCH] ARCNET: fix hard_header_len limit
@ 2015-08-05 15:34 Michael Grzeschik
  2015-09-16 12:47 ` Michael Grzeschik
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Grzeschik @ 2015-08-05 15:34 UTC (permalink / raw
  To: David Miller; +Cc: netdev, linux-kernel, kernel

On Thu, Jul 30, 2015 at 11:16:36AM -0700, David Miller wrote:
> From: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Date: Thu, 30 Jul 2015 15:34:36 +0200
> 
> > The commit <9c7077622dd9> ("packet: make packet_snd fail on len smaller
> > than l2 header") adds the check for minimum packet length of the used l2.
> > For arcnet the hardware header length is not the complete archdr which
> > includes hard + soft header. This patch changes the length to
> > sizeof(arc_hardware).
> > 
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> 
> The hard header len is used for other purposes as well, are you sure
> those don't get broken by this change?

Its meaning is to represent the amount of the hardware (link layer)
data of one packet.

Which other purposes do you mean?
Can you point to some code?

> Code assumes that if the data at the SKB mac pointer is taken, for
> dev->hard_header_len bytes, that is exactly the link layer header.
> And that this can be used to compare two MAC headers, copy the
> MAC header from one packet to another, etc.

The link layer size of arcnet is 4 bytes long. 1 byte source, 1 byte
dest and two offset bytes. As described by struct arc_hardware in
if_arcnet.h . The above condition is fulfilled when the mac pointer
is 0.

The following pending bytes of struct archdr have a variable meaning
depending of the used protocol and are represented by an union.
(network layer)

In the case of raw packets, the payload comes immediately after the
hard_header.

Thanks,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] ARCNET: fix hard_header_len limit
  2015-08-05 15:34 [PATCH] ARCNET: fix hard_header_len limit Michael Grzeschik
@ 2015-09-16 12:47 ` Michael Grzeschik
  2015-09-16 17:53   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Grzeschik @ 2015-09-16 12:47 UTC (permalink / raw
  To: David Miller; +Cc: netdev, linux-kernel, kernel

On Wed, Aug 05, 2015 at 05:34:51PM +0200, Michael Grzeschik wrote:
> On Thu, Jul 30, 2015 at 11:16:36AM -0700, David Miller wrote:
> > From: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > Date: Thu, 30 Jul 2015 15:34:36 +0200
> > 
> > > The commit <9c7077622dd9> ("packet: make packet_snd fail on len smaller
> > > than l2 header") adds the check for minimum packet length of the used l2.
> > > For arcnet the hardware header length is not the complete archdr which
> > > includes hard + soft header. This patch changes the length to
> > > sizeof(arc_hardware).
> > > 
> > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > 
> > The hard header len is used for other purposes as well, are you sure
> > those don't get broken by this change?
> 
> Its meaning is to represent the amount of the hardware (link layer)
> data of one packet.
> 
> Which other purposes do you mean?
> Can you point to some code?
> 
> > Code assumes that if the data at the SKB mac pointer is taken, for
> > dev->hard_header_len bytes, that is exactly the link layer header.
> > And that this can be used to compare two MAC headers, copy the
> > MAC header from one packet to another, etc.
> 
> The link layer size of arcnet is 4 bytes long. 1 byte source, 1 byte
> dest and two offset bytes. As described by struct arc_hardware in
> if_arcnet.h . The above condition is fulfilled when the mac pointer
> is 0.
> 
> The following pending bytes of struct archdr have a variable meaning
> depending of the used protocol and are represented by an union.
> (network layer)
> 
> In the case of raw packets, the payload comes immediately after the
> hard_header.
> 

Ping!

I have the cleanup patches from Joe Perches and several ARCNET patches
on top, waiting to be posted on the list. What is your Opinion to my
Maintainer Request I send some weeks ago?

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH] ARCNET: fix hard_header_len limit
  2015-09-16 12:47 ` Michael Grzeschik
@ 2015-09-16 17:53   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-09-16 17:53 UTC (permalink / raw
  To: mgr; +Cc: netdev, linux-kernel, kernel

From: Michael Grzeschik <mgr@pengutronix.de>
Date: Wed, 16 Sep 2015 14:47:13 +0200

> I have the cleanup patches from Joe Perches and several ARCNET patches
> on top, waiting to be posted on the list. What is your Opinion to my
> Maintainer Request I send some weeks ago?

Please just repost this patch anew, thanks.

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

end of thread, other threads:[~2015-09-16 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 15:34 [PATCH] ARCNET: fix hard_header_len limit Michael Grzeschik
2015-09-16 12:47 ` Michael Grzeschik
2015-09-16 17:53   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2015-07-30 13:34 Michael Grzeschik
2015-07-30 18:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).