Re: [PATCH] ARCNET: fix hard_header_len limit

David Miller
2015-07-30T18:16:39Z

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.