Commit a298830c authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[NET]: Fix TX checksum feature check

This patch fixes a boolean error in the new TX checksum check
that causes bogus TSO packets to be generated.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58e50a90
...@@ -1509,11 +1509,11 @@ int dev_queue_xmit(struct sk_buff *skb) ...@@ -1509,11 +1509,11 @@ int dev_queue_xmit(struct sk_buff *skb)
skb_set_transport_header(skb, skb->csum_start - skb_set_transport_header(skb, skb->csum_start -
skb_headroom(skb)); skb_headroom(skb));
if (!(dev->features & NETIF_F_GEN_CSUM) if (!(dev->features & NETIF_F_GEN_CSUM) &&
|| ((dev->features & NETIF_F_IP_CSUM) !((dev->features & NETIF_F_IP_CSUM) &&
&& skb->protocol == htons(ETH_P_IP)) skb->protocol == htons(ETH_P_IP)) &&
|| ((dev->features & NETIF_F_IPV6_CSUM) !((dev->features & NETIF_F_IPV6_CSUM) &&
&& skb->protocol == htons(ETH_P_IPV6))) skb->protocol == htons(ETH_P_IPV6)))
if (skb_checksum_help(skb)) if (skb_checksum_help(skb))
goto out_kfree_skb; goto out_kfree_skb;
} }
......
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