Commit 5b70ca35 authored by Li RongQing's avatar Li RongQing Committed by David S. Miller

ksz884x: fix Endian

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: default avatarLi RongQing <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e01df28
...@@ -4879,8 +4879,8 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -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); left = hw_alloc_pkt(hw, skb->len, num);
if (left) { if (left) {
if (left < num || if (left < num ||
((CHECKSUM_PARTIAL == skb->ip_summed) && (CHECKSUM_PARTIAL == skb->ip_summed &&
(ETH_P_IPV6 == htons(skb->protocol)))) { skb->protocol == htons(ETH_P_IPV6))) {
struct sk_buff *org_skb = skb; struct sk_buff *org_skb = skb;
skb = netdev_alloc_skb(dev, org_skb->len); skb = netdev_alloc_skb(dev, org_skb->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment