[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>

authored by

Jiri Benc and committed by
David S. Miller
5ba0eac6 b597ef47

+1 -1
+1 -1
include/linux/netdevice.h
··· 204 /* cached hardware header; allow for machine alignment needs. */ 205 #define HH_DATA_MOD 16 206 #define HH_DATA_OFF(__len) \ 207 - (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) 208 #define HH_DATA_ALIGN(__len) \ 209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) 210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
··· 204 /* cached hardware header; allow for machine alignment needs. */ 205 #define HH_DATA_MOD 16 206 #define HH_DATA_OFF(__len) \ 207 + (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) 208 #define HH_DATA_ALIGN(__len) \ 209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) 210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];