]> Pileus Git - ~andy/linux/blobdiff - net/core/dev.c
Merge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / net / core / dev.c
index 8efe85070131df938e924c493444fd0a43e5c750..9444c5cb413798f8b620f1a3a6b703a7c413e55e 100644 (file)
@@ -199,6 +199,11 @@ static struct list_head ptype_all __read_mostly;   /* Taps */
 DEFINE_RWLOCK(dev_base_lock);
 EXPORT_SYMBOL(dev_base_lock);
 
+static inline void dev_base_seq_inc(struct net *net)
+{
+       while (++net->dev_base_seq == 0);
+}
+
 static inline struct hlist_head *dev_name_hash(struct net *net, const char *name)
 {
        unsigned hash = full_name_hash(name, strnlen(name, IFNAMSIZ));
@@ -237,6 +242,9 @@ static int list_netdevice(struct net_device *dev)
        hlist_add_head_rcu(&dev->index_hlist,
                           dev_index_hash(net, dev->ifindex));
        write_unlock_bh(&dev_base_lock);
+
+       dev_base_seq_inc(net);
+
        return 0;
 }
 
@@ -253,6 +261,8 @@ static void unlist_netdevice(struct net_device *dev)
        hlist_del_rcu(&dev->name_hlist);
        hlist_del_rcu(&dev->index_hlist);
        write_unlock_bh(&dev_base_lock);
+
+       dev_base_seq_inc(dev_net(dev));
 }
 
 /*
@@ -2532,7 +2542,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
                        goto done;
 
                ip = (const struct iphdr *) (skb->data + nhoff);
-               if (ip->frag_off & htons(IP_MF | IP_OFFSET))
+               if (ip_is_fragment(ip))
                        ip_proto = 0;
                else
                        ip_proto = ip->protocol;
@@ -5199,7 +5209,7 @@ static void rollback_registered(struct net_device *dev)
        list_del(&single);
 }
 
-u32 netdev_fix_features(struct net_device *dev, u32 features)
+static u32 netdev_fix_features(struct net_device *dev, u32 features)
 {
        /* Fix illegal checksum combinations */
        if ((features & NETIF_F_HW_CSUM) &&
@@ -5258,7 +5268,6 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
 
        return features;
 }
-EXPORT_SYMBOL(netdev_fix_features);
 
 int __netdev_update_features(struct net_device *dev)
 {
@@ -5478,11 +5487,9 @@ int register_netdevice(struct net_device *dev)
                dev->features |= NETIF_F_NOCACHE_COPY;
        }
 
-       /* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
-        * vlan_dev_init() will do the dev->features check, so these features
-        * are enabled only if supported by underlying device.
+       /* Make NETIF_F_HIGHDMA inheritable to VLAN devices.
         */
-       dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA);
+       dev->vlan_features |= NETIF_F_HIGHDMA;
 
        ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
        ret = notifier_to_errno(ret);