[NET]: Make the device list and device lookups per namespace.
[deliverable/linux.git] / drivers / net / shaper.c
index e886e8d7cfdfbdceeec0576e87fb5b91734d6dfa..3773b3858bd4a84f5edfbb900a64871b9f7ea646 100644 (file)
@@ -86,6 +86,7 @@
 
 #include <net/dst.h>
 #include <net/arp.h>
+#include <net/net_namespace.h>
 
 struct shaper_cb {
        unsigned long   shapeclock;             /* Time it should go out */
@@ -488,7 +489,7 @@ static int shaper_ioctl(struct net_device *dev,  struct ifreq *ifr, int cmd)
        {
                case SHAPER_SET_DEV:
                {
-                       struct net_device *them=__dev_get_by_name(ss->ss_name);
+                       struct net_device *them=__dev_get_by_name(&init_net, ss->ss_name);
                        if(them==NULL)
                                return -ENODEV;
                        if(sh->dev)
@@ -600,10 +601,9 @@ static int __init shaper_init(void)
                return -ENODEV;
 
        alloc_size = sizeof(*dev) * shapers;
-       devs = kmalloc(alloc_size, GFP_KERNEL);
+       devs = kzalloc(alloc_size, GFP_KERNEL);
        if (!devs)
                return -ENOMEM;
-       memset(devs, 0, alloc_size);
 
        for (i = 0; i < shapers; i++) {
 
This page took 0.02628 seconds and 5 git commands to generate.