]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Fix HH_DATA_OFF.
authorJiri Benc <jbenc@suse.cz>
Thu, 2 Jun 2005 23:48:05 +0000 (16:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jun 2005 23:48:05 +0000 (16:48 -0700)
When the hardware header size is a multiple of HH_DATA_MOD, HH_DATA_OFF()
incorrectly returns HH_DATA_MOD (instead of 0). This affects ieee80211 layer
as 802.11 header is 32 bytes long.

Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index 470af8c1a4a01a680198b53a2fe3da15d3f2c2c0..ba5d1236aa170c75a92c1137e34b3c0fb242f93b 100644 (file)
@@ -204,7 +204,7 @@ struct hh_cache
        /* cached hardware header; allow for machine alignment needs.        */
 #define HH_DATA_MOD    16
 #define HH_DATA_OFF(__len) \
-       (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1)))
+       (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))
 #define HH_DATA_ALIGN(__len) \
        (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
        unsigned long   hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];