summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@suse.cz>2005-06-02 16:48:05 -0700
committerDavid S. Miller <davem@davemloft.net>2005-06-02 16:48:05 -0700
commit5ba0eac6e0b7e2889649a1105d97c600595e2bb1 (patch)
treee7bc652889162d1b7997e779ce5a5fef4355838f /include/linux/netdevice.h
parentb597ef4712c05c962640a655386a7f06cc1a1fbc (diff)
downloadop-kernel-dev-5ba0eac6e0b7e2889649a1105d97c600595e2bb1.zip
op-kernel-dev-5ba0eac6e0b7e2889649a1105d97c600595e2bb1.tar.gz
[NET]: Fix HH_DATA_OFF.
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>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 470af8c..ba5d123 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)];
OpenPOWER on IntegriCloud