Gertjan van Wingerde <gwingerde-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> writes: > On 11/29/09 00:55, Benoit PAPILLAULT wrote: >> Gertjan van Wingerde a écrit : >>> On 11/28/09 22:26, Ivo van Doorn wrote: >>>>> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c >>>>> index b8f0954..562a344 100644 >>>>> --- a/drivers/net/wireless/rt2x00/rt2x00queue.c >>>>> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c >>>>> @@ -181,7 +181,7 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length) >>>>> unsigned int frame_length = skb->len; >>>>> unsigned int header_align = ALIGN_SIZE(skb, 0); >>>>> unsigned int payload_align = ALIGN_SIZE(skb, header_length); >>>>> - unsigned int l2pad = 4 - (payload_align - header_align); >>>>> + unsigned int l2pad = 4 - (header_length & 3); >> >> Humm... is header_length = 24, then your formula gives l2pad = 4. If so, >> this is wrong. Do I miss something? > > No, you are right. The formula needs another & 3 on the overall result to account for that situation. > So, it should be: > > unsigned int l2pad = (4 - (header_length & 3)) & 3; aka unsigned int l2pad = -header_length & 3; Andreas. -- Andreas Schwab, schwab@xxxxxxxxxxxxxx GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html