From patchwork Thu Dec 13 06:49:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Quantal,10/29] be2net: Fix Endian Date: Wed, 12 Dec 2012 20:49:43 -0000 From: Jesse Sung X-Patchwork-Id: 205752 Message-Id: <1355381402-10497-10-git-send-email-jesse.sung@canonical.com> To: kernel-team@lists.ubuntu.com Cc: Li RongQing , Sarveshwar Bandi From: Li RongQing BugLink: https://launchpad.net/bugs/1083088 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 Signed-off-by: Li RongQing Acked-by: Somnath Kotur Signed-off-by: David S. Miller (cherry picked from commit e8efcec5394cbf7ae67ccb137cb1a45ae3e6f6c8) Signed-off-by: Wen-chien Jesse Sung --- drivers/net/ethernet/emulex/benet/be.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 793ee6b..de4c61e 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h @@ -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)