Skip to content

Commit

Permalink
ksz884x: 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, Using htons on skb->protocol is wrong.

And fix two code style issues: indentation and remove
unnecessary parentheses.

CC: Tristram Ha <Tristram.Ha@micrel.com>
CC: Ben Hutchings <bhutchings@solarflare.com>
CC: Joe Perches <joe@perches.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Jul 11, 2012
1 parent 4e01df2 commit 5b70ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/micrel/ksz884x.c
Original file line number Diff line number Diff line change
Expand Up @@ -4879,8 +4879,8 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
left = hw_alloc_pkt(hw, skb->len, num);
if (left) {
if (left < num ||
((CHECKSUM_PARTIAL == skb->ip_summed) &&
(ETH_P_IPV6 == htons(skb->protocol)))) {
(CHECKSUM_PARTIAL == skb->ip_summed &&
skb->protocol == htons(ETH_P_IPV6))) {
struct sk_buff *org_skb = skb;

skb = netdev_alloc_skb(dev, org_skb->len);
Expand Down

0 comments on commit 5b70ca3

Please sign in to comment.