be2net: Fix Endian
Subsystems (3)
PATCH 1/2 be2net: Fix Endian
From: Li RongQing <[email protected]>
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.
--- drivers/net/ethernet/emulex/benet/be.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/emulex/benet/be.h +1 -1
@@ -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)
Signature · 1 line
1.7.1
Quoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, July 05, 2012 7:36 AM
To: [email protected]
Cc: Kotur, Somnath
Subject: [PATCH 1/2] be2net: Fix Endian
Quoted 8 lines
From: Li RongQing <[email protected]>
ETH_P_IPis host Endian,skb->protocolis big Endian, when compare them, we should changeETH_P_IPfrom host endian to big endian, htons, not ntohs.CC Somnath Kotur <[email protected]>Signed-off-by Li RongQing <[email protected]>
Oops! Unintended...Thanks!
From: [email protected]
Date: Thu, 5 Jul 2012 10:05:42 +0800
Quoted 8 lines
From: Li RongQing <[email protected]>
ETH_P_IPis host Endian,skb->protocolis big Endian, when compare them, we should changeETH_P_IPfrom host endian to big endian, htons, not ntohs.CC Somnath Kotur <[email protected]>Signed-off-by Li RongQing <[email protected]>
Applied to net-next since this actually doesn't cause any real problems winc htons() and ntohs() are implemented identically and perform the same operation.
Thanks.