Merge branches 'x86/acpi', 'x86/asm', 'x86/cpudetect', 'x86/crashdump', 'x86/debug...
[safe/jmp/linux-2.6] / net / ipv6 / ip6_tunnel.c
index adfcd65..d994c55 100644 (file)
@@ -249,8 +249,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
        }
 
        t = netdev_priv(dev);
-       ip6_tnl_dev_init(dev);
        t->parms = *p;
+       ip6_tnl_dev_init(dev);
 
        if ((err = register_netdevice(dev)) < 0)
                goto failed_free;
@@ -846,6 +846,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
                         int encap_limit,
                         __u32 *pmtu)
 {
+       struct net *net = dev_net(dev);
        struct ip6_tnl *t = netdev_priv(dev);
        struct net_device_stats *stats = &t->dev->stats;
        struct ipv6hdr *ipv6h = ipv6_hdr(skb);
@@ -861,9 +862,9 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
        if ((dst = ip6_tnl_dst_check(t)) != NULL)
                dst_hold(dst);
        else {
-               dst = ip6_route_output(dev_net(dev), NULL, fl);
+               dst = ip6_route_output(net, NULL, fl);
 
-               if (dst->error || xfrm_lookup(&dst, fl, NULL, 0) < 0)
+               if (dst->error || xfrm_lookup(net, &dst, fl, NULL, 0) < 0)
                        goto tx_err_link_failure;
        }
 
@@ -1150,7 +1151,6 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
  * ip6_tnl_change - update the tunnel parameters
  *   @t: tunnel to be changed
  *   @p: tunnel configuration parameters
- *   @active: != 0 if tunnel is ready for use
  *
  * Description:
  *   ip6_tnl_change() updates the tunnel parameters
@@ -1429,9 +1429,9 @@ static int ip6_tnl_init_net(struct net *net)
 
        if (!ip6n->fb_tnl_dev)
                goto err_alloc_dev;
+       dev_net_set(ip6n->fb_tnl_dev, net);
 
        ip6_fb_tnl_dev_init(ip6n->fb_tnl_dev);
-       dev_net_set(ip6n->fb_tnl_dev, net);
 
        err = register_netdev(ip6n->fb_tnl_dev);
        if (err < 0)