]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/8021q/vlan_dev.c
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
[mv-sheeva.git] / net / 8021q / vlan_dev.c
index 0e3b2d3e2339be908f0a631c341cb53187b750b1..5d055c242ed8e224ea602bce5291c10f059af90c 100644 (file)
@@ -153,9 +153,6 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
        struct net_device_stats *stats;
        unsigned short vlan_TCI;
 
-       if (dev_net(dev) != &init_net)
-               goto err_free;
-
        skb = skb_share_check(skb, GFP_ATOMIC);
        if (skb == NULL)
                goto err_free;
@@ -666,6 +663,8 @@ static int vlan_dev_init(struct net_device *dev)
                                          (1<<__LINK_STATE_DORMANT))) |
                      (1<<__LINK_STATE_PRESENT);
 
+       dev->features |= real_dev->features & real_dev->vlan_features;
+
        /* ipv6 shared card related stuff */
        dev->dev_id = real_dev->dev_id;
 
@@ -692,6 +691,20 @@ static int vlan_dev_init(struct net_device *dev)
        return 0;
 }
 
+static void vlan_dev_uninit(struct net_device *dev)
+{
+       struct vlan_priority_tci_mapping *pm;
+       struct vlan_dev_info *vlan = vlan_dev_info(dev);
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) {
+               while ((pm = vlan->egress_priority_map[i]) != NULL) {
+                       vlan->egress_priority_map[i] = pm->next;
+                       kfree(pm);
+               }
+       }
+}
+
 void vlan_setup(struct net_device *dev)
 {
        ether_setup(dev);
@@ -701,6 +714,7 @@ void vlan_setup(struct net_device *dev)
 
        dev->change_mtu         = vlan_dev_change_mtu;
        dev->init               = vlan_dev_init;
+       dev->uninit             = vlan_dev_uninit;
        dev->open               = vlan_dev_open;
        dev->stop               = vlan_dev_stop;
        dev->set_mac_address    = vlan_dev_set_mac_address;