Re: TG3 network data corruption regression 2.6.24/2.6.23.4

From: David Miller
Date: Tue Apr 15 2008 - 23:31:22 EST


From: Tony Battersby <tonyb@xxxxxxxxxxxxxxx>
Date: Tue, 15 Apr 2008 11:39:27 -0400

> Thanks, your patch fixes the problem (tested on 2.6.24.4). However, I
> had to change "(skb->mac_header & 3)" in your patch to "((long)
> skb->mac_header & 3)" since mac_header is a pointer rather than an int
> on 32-bit systems.
>
> Tested-by: Tony Battersby <tonyb@xxxxxxxxxxxxxxx>

Thanks for testing.

Matt, skb->mac_header is either a pointer or an integer offset
depending upon whether we are building 32-bit or 64-bit.

Testing skb->mac_header is therefore wrong, because it's an
offset from a pointer in the 64-bit case and therefore it's
alignment does not indicate correctly the actual final alignment
of skb->head + skb->max_header.

Therefore you should test skb_mac_header(skb) and cast it with
(unsigned long).

Please respin this fix with that correction so I can apply it
and get this bug fixed, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/