diff options
| -rw-r--r-- | net/mac80211/rx.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 5cf7285f6df9..1892f883bd7f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -1962,19 +1962,17 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) | |||
| 1962 | } | 1962 | } |
| 1963 | } | 1963 | } |
| 1964 | 1964 | ||
| 1965 | if (skb) { | ||
| 1966 | #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | 1965 | #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS |
| 1967 | /* | 1966 | if (skb) { |
| 1968 | * 'align' will only take the values 0 or 2 here | 1967 | /* 'align' will only take the values 0 or 2 here since all |
| 1969 | * since all frames are required to be aligned | 1968 | * frames are required to be aligned to 2-byte boundaries |
| 1970 | * to 2-byte boundaries when being passed to | 1969 | * when being passed to mac80211; the code here works just |
| 1971 | * mac80211; the code here works just as well if | 1970 | * as well if that isn't true, but mac80211 assumes it can |
| 1972 | * that isn't true, but mac80211 assumes it can | 1971 | * access fields as 2-byte aligned (e.g. for ether_addr_equal) |
| 1973 | * access fields as 2-byte aligned (e.g. for | ||
| 1974 | * compare_ether_addr) | ||
| 1975 | */ | 1972 | */ |
| 1976 | int align = ((unsigned long)(skb->data + | 1973 | int align; |
| 1977 | sizeof(struct ethhdr))) & 3; | 1974 | |
| 1975 | align = (unsigned long)(skb->data + sizeof(struct ethhdr)) & 3; | ||
| 1978 | if (align) { | 1976 | if (align) { |
| 1979 | if (WARN_ON(skb_headroom(skb) < 3)) { | 1977 | if (WARN_ON(skb_headroom(skb) < 3)) { |
| 1980 | dev_kfree_skb(skb); | 1978 | dev_kfree_skb(skb); |
| @@ -1987,14 +1985,14 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) | |||
| 1987 | skb_set_tail_pointer(skb, len); | 1985 | skb_set_tail_pointer(skb, len); |
| 1988 | } | 1986 | } |
| 1989 | } | 1987 | } |
| 1988 | } | ||
| 1990 | #endif | 1989 | #endif |
| 1991 | 1990 | ||
| 1992 | if (skb) { | 1991 | if (skb) { |
| 1993 | /* deliver to local stack */ | 1992 | /* deliver to local stack */ |
| 1994 | skb->protocol = eth_type_trans(skb, dev); | 1993 | skb->protocol = eth_type_trans(skb, dev); |
| 1995 | memset(skb->cb, 0, sizeof(skb->cb)); | 1994 | memset(skb->cb, 0, sizeof(skb->cb)); |
| 1996 | netif_receive_skb(skb); | 1995 | netif_receive_skb(skb); |
| 1997 | } | ||
| 1998 | } | 1996 | } |
| 1999 | 1997 | ||
| 2000 | if (xmit_skb) { | 1998 | if (xmit_skb) { |
