diff options
Diffstat (limited to 'net/bluetooth/bnep/netdev.c')
-rw-r--r-- | net/bluetooth/bnep/netdev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c index 7f7b27db6a8f..67a002a9751a 100644 --- a/net/bluetooth/bnep/netdev.c +++ b/net/bluetooth/bnep/netdev.c | |||
@@ -158,14 +158,15 @@ static inline int bnep_net_mc_filter(struct sk_buff *skb, struct bnep_session *s | |||
158 | static inline u16 bnep_net_eth_proto(struct sk_buff *skb) | 158 | static inline u16 bnep_net_eth_proto(struct sk_buff *skb) |
159 | { | 159 | { |
160 | struct ethhdr *eh = (void *) skb->data; | 160 | struct ethhdr *eh = (void *) skb->data; |
161 | u16 proto = ntohs(eh->h_proto); | ||
161 | 162 | ||
162 | if (ntohs(eh->h_proto) >= 1536) | 163 | if (proto >= 1536) |
163 | return eh->h_proto; | 164 | return proto; |
164 | 165 | ||
165 | if (get_unaligned((u16 *) skb->data) == 0xFFFF) | 166 | if (get_unaligned((__be16 *) skb->data) == htons(0xFFFF)) |
166 | return htons(ETH_P_802_3); | 167 | return ETH_P_802_3; |
167 | 168 | ||
168 | return htons(ETH_P_802_2); | 169 | return ETH_P_802_2; |
169 | } | 170 | } |
170 | 171 | ||
171 | static inline int bnep_net_proto_filter(struct sk_buff *skb, struct bnep_session *s) | 172 | static inline int bnep_net_proto_filter(struct sk_buff *skb, struct bnep_session *s) |