Skip to content

Commit

Permalink
be2net: Fix Endian
Browse files Browse the repository at this point in the history
ETH_P_IP is host Endian, skb->protocol is big Endian, when
compare them, we should change ETH_P_IP from host endian
to big endian, htons, not ntohs.

CC: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Jul 9, 2012
1 parent 806a0fb commit e8efcec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/emulex/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static inline u8 is_udp_pkt(struct sk_buff *skb)

static inline bool is_ipv4_pkt(struct sk_buff *skb)
{
return skb->protocol == ntohs(ETH_P_IP) && ip_hdr(skb)->version == 4;
return skb->protocol == htons(ETH_P_IP) && ip_hdr(skb)->version == 4;
}

static inline void be_vf_eth_addr_generate(struct be_adapter *adapter, u8 *mac)
Expand Down

0 comments on commit e8efcec

Please sign in to comment.