aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ee051bb398a0..a0a46e7ed137 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1509,9 +1509,11 @@ int dev_queue_xmit(struct sk_buff *skb)
1509 skb_set_transport_header(skb, skb->csum_start - 1509 skb_set_transport_header(skb, skb->csum_start -
1510 skb_headroom(skb)); 1510 skb_headroom(skb));
1511 1511
1512 if (!(dev->features & NETIF_F_GEN_CSUM) && 1512 if (!(dev->features & NETIF_F_GEN_CSUM)
1513 (!(dev->features & NETIF_F_IP_CSUM) || 1513 || ((dev->features & NETIF_F_IP_CSUM)
1514 skb->protocol != htons(ETH_P_IP))) 1514 && skb->protocol == htons(ETH_P_IP))
1515 || ((dev->features & NETIF_F_IPV6_CSUM)
1516 && skb->protocol == htons(ETH_P_IPV6)))
1515 if (skb_checksum_help(skb)) 1517 if (skb_checksum_help(skb))
1516 goto out_kfree_skb; 1518 goto out_kfree_skb;
1517 } 1519 }
@@ -3107,6 +3109,22 @@ int register_netdevice(struct net_device *dev)
3107 } 3109 }
3108 } 3110 }
3109 3111
3112 /* Fix illegal checksum combinations */
3113 if ((dev->features & NETIF_F_HW_CSUM) &&
3114 (dev->features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
3115 printk(KERN_NOTICE "%s: mixed HW and IP checksum settings.\n",
3116 dev->name);
3117 dev->features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
3118 }
3119
3120 if ((dev->features & NETIF_F_NO_CSUM) &&
3121 (dev->features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
3122 printk(KERN_NOTICE "%s: mixed no checksumming and other settings.\n",
3123 dev->name);
3124 dev->features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM);
3125 }
3126
3127
3110 /* Fix illegal SG+CSUM combinations. */ 3128 /* Fix illegal SG+CSUM combinations. */
3111 if ((dev->features & NETIF_F_SG) && 3129 if ((dev->features & NETIF_F_SG) &&
3112 !(dev->features & NETIF_F_ALL_CSUM)) { 3130 !(dev->features & NETIF_F_ALL_CSUM)) {