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.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 81c426adcd1e..e660cb57e42a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -98,7 +98,6 @@
98#include <linux/seq_file.h> 98#include <linux/seq_file.h>
99#include <linux/stat.h> 99#include <linux/stat.h>
100#include <linux/if_bridge.h> 100#include <linux/if_bridge.h>
101#include <linux/divert.h>
102#include <net/dst.h> 101#include <net/dst.h>
103#include <net/pkt_sched.h> 102#include <net/pkt_sched.h>
104#include <net/checksum.h> 103#include <net/checksum.h>
@@ -1170,7 +1169,7 @@ EXPORT_SYMBOL(netif_device_attach);
1170 */ 1169 */
1171int skb_checksum_help(struct sk_buff *skb) 1170int skb_checksum_help(struct sk_buff *skb)
1172{ 1171{
1173 unsigned int csum; 1172 __wsum csum;
1174 int ret = 0, offset = skb->h.raw - skb->data; 1173 int ret = 0, offset = skb->h.raw - skb->data;
1175 1174
1176 if (skb->ip_summed == CHECKSUM_COMPLETE) 1175 if (skb->ip_summed == CHECKSUM_COMPLETE)
@@ -1192,9 +1191,9 @@ int skb_checksum_help(struct sk_buff *skb)
1192 1191
1193 offset = skb->tail - skb->h.raw; 1192 offset = skb->tail - skb->h.raw;
1194 BUG_ON(offset <= 0); 1193 BUG_ON(offset <= 0);
1195 BUG_ON(skb->csum + 2 > offset); 1194 BUG_ON(skb->csum_offset + 2 > offset);
1196 1195
1197 *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); 1196 *(__sum16*)(skb->h.raw + skb->csum_offset) = csum_fold(csum);
1198 1197
1199out_set_summed: 1198out_set_summed:
1200 skb->ip_summed = CHECKSUM_NONE; 1199 skb->ip_summed = CHECKSUM_NONE;
@@ -1216,7 +1215,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
1216{ 1215{
1217 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); 1216 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
1218 struct packet_type *ptype; 1217 struct packet_type *ptype;
1219 int type = skb->protocol; 1218 __be16 type = skb->protocol;
1220 int err; 1219 int err;
1221 1220
1222 BUG_ON(skb_shinfo(skb)->frag_list); 1221 BUG_ON(skb_shinfo(skb)->frag_list);
@@ -1767,7 +1766,7 @@ int netif_receive_skb(struct sk_buff *skb)
1767 struct packet_type *ptype, *pt_prev; 1766 struct packet_type *ptype, *pt_prev;
1768 struct net_device *orig_dev; 1767 struct net_device *orig_dev;
1769 int ret = NET_RX_DROP; 1768 int ret = NET_RX_DROP;
1770 unsigned short type; 1769 __be16 type;
1771 1770
1772 /* if we've gotten here through NAPI, check netpoll */ 1771 /* if we've gotten here through NAPI, check netpoll */
1773 if (skb->dev->poll && netpoll_rx(skb)) 1772 if (skb->dev->poll && netpoll_rx(skb))
@@ -1827,8 +1826,6 @@ int netif_receive_skb(struct sk_buff *skb)
1827ncls: 1826ncls:
1828#endif 1827#endif
1829 1828
1830 handle_diverter(skb);
1831
1832 if (handle_bridge(&skb, &pt_prev, &ret, orig_dev)) 1829 if (handle_bridge(&skb, &pt_prev, &ret, orig_dev))
1833 goto out; 1830 goto out;
1834 1831
@@ -2898,10 +2895,6 @@ int register_netdevice(struct net_device *dev)
2898 spin_lock_init(&dev->ingress_lock); 2895 spin_lock_init(&dev->ingress_lock);
2899#endif 2896#endif
2900 2897
2901 ret = alloc_divert_blk(dev);
2902 if (ret)
2903 goto out;
2904
2905 dev->iflink = -1; 2898 dev->iflink = -1;
2906 2899
2907 /* Init, if this function is available */ 2900 /* Init, if this function is available */
@@ -2910,13 +2903,13 @@ int register_netdevice(struct net_device *dev)
2910 if (ret) { 2903 if (ret) {
2911 if (ret > 0) 2904 if (ret > 0)
2912 ret = -EIO; 2905 ret = -EIO;
2913 goto out_err; 2906 goto out;
2914 } 2907 }
2915 } 2908 }
2916 2909
2917 if (!dev_valid_name(dev->name)) { 2910 if (!dev_valid_name(dev->name)) {
2918 ret = -EINVAL; 2911 ret = -EINVAL;
2919 goto out_err; 2912 goto out;
2920 } 2913 }
2921 2914
2922 dev->ifindex = dev_new_index(); 2915 dev->ifindex = dev_new_index();
@@ -2930,7 +2923,7 @@ int register_netdevice(struct net_device *dev)
2930 = hlist_entry(p, struct net_device, name_hlist); 2923 = hlist_entry(p, struct net_device, name_hlist);
2931 if (!strncmp(d->name, dev->name, IFNAMSIZ)) { 2924 if (!strncmp(d->name, dev->name, IFNAMSIZ)) {
2932 ret = -EEXIST; 2925 ret = -EEXIST;
2933 goto out_err; 2926 goto out;
2934 } 2927 }
2935 } 2928 }
2936 2929
@@ -2974,7 +2967,7 @@ int register_netdevice(struct net_device *dev)
2974 2967
2975 ret = netdev_register_sysfs(dev); 2968 ret = netdev_register_sysfs(dev);
2976 if (ret) 2969 if (ret)
2977 goto out_err; 2970 goto out;
2978 dev->reg_state = NETREG_REGISTERED; 2971 dev->reg_state = NETREG_REGISTERED;
2979 2972
2980 /* 2973 /*
@@ -3001,9 +2994,6 @@ int register_netdevice(struct net_device *dev)
3001 2994
3002out: 2995out:
3003 return ret; 2996 return ret;
3004out_err:
3005 free_divert_blk(dev);
3006 goto out;
3007} 2997}
3008 2998
3009/** 2999/**
@@ -3035,15 +3025,6 @@ int register_netdev(struct net_device *dev)
3035 goto out; 3025 goto out;
3036 } 3026 }
3037 3027
3038 /*
3039 * Back compatibility hook. Kill this one in 2.5
3040 */
3041 if (dev->name[0] == 0 || dev->name[0] == ' ') {
3042 err = dev_alloc_name(dev, "eth%d");
3043 if (err < 0)
3044 goto out;
3045 }
3046
3047 err = register_netdevice(dev); 3028 err = register_netdevice(dev);
3048out: 3029out:
3049 rtnl_unlock(); 3030 rtnl_unlock();
@@ -3329,8 +3310,6 @@ int unregister_netdevice(struct net_device *dev)
3329 /* Notifier chain MUST detach us from master device. */ 3310 /* Notifier chain MUST detach us from master device. */
3330 BUG_TRAP(!dev->master); 3311 BUG_TRAP(!dev->master);
3331 3312
3332 free_divert_blk(dev);
3333
3334 /* Finish processing unregister after unlock */ 3313 /* Finish processing unregister after unlock */
3335 net_set_todo(dev); 3314 net_set_todo(dev);
3336 3315
@@ -3361,7 +3340,6 @@ void unregister_netdev(struct net_device *dev)
3361 3340
3362EXPORT_SYMBOL(unregister_netdev); 3341EXPORT_SYMBOL(unregister_netdev);
3363 3342
3364#ifdef CONFIG_HOTPLUG_CPU
3365static int dev_cpu_callback(struct notifier_block *nfb, 3343static int dev_cpu_callback(struct notifier_block *nfb,
3366 unsigned long action, 3344 unsigned long action,
3367 void *ocpu) 3345 void *ocpu)
@@ -3405,7 +3383,6 @@ static int dev_cpu_callback(struct notifier_block *nfb,
3405 3383
3406 return NOTIFY_OK; 3384 return NOTIFY_OK;
3407} 3385}
3408#endif /* CONFIG_HOTPLUG_CPU */
3409 3386
3410#ifdef CONFIG_NET_DMA 3387#ifdef CONFIG_NET_DMA
3411/** 3388/**