netns: Fix reassembly timer to use the right namespace
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Sat, 3 May 2008 00:02:03 +0000 (17:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 May 2008 00:02:03 +0000 (17:02 -0700)
This trivial fix retrieves the network namespace from frag queue
and use it to get the network device in the right namespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/reassembly.c

index 7b247e3a16fe4873feee9e3e903f835d54a61a70..798cabc7535b747d9193ce20e1dce1907e18eb8f 100644 (file)
@@ -197,6 +197,7 @@ static void ip6_frag_expire(unsigned long data)
 {
        struct frag_queue *fq;
        struct net_device *dev = NULL;
+       struct net *net;
 
        fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
 
@@ -207,7 +208,8 @@ static void ip6_frag_expire(unsigned long data)
 
        fq_kill(fq);
 
-       dev = dev_get_by_index(&init_net, fq->iif);
+       net = container_of(fq->q.net, struct net, ipv6.frags);
+       dev = dev_get_by_index(net, fq->iif);
        if (!dev)
                goto out;