]> git.neil.brown.name Git - history.git/commitdiff
[NET]: Fix tunnel device bugs added by alloc_netdev() changes.
authorVille Nuorvala <vnuorval@tcs.hut.fi>
Wed, 9 Jul 2003 13:45:47 +0000 (06:45 -0700)
committerStephen Hemminger <shemminger@osdl.org>
Wed, 9 Jul 2003 13:45:47 +0000 (06:45 -0700)
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv6/sit.c

index 8d72a478f24489267b26f094ee379495e5a913dc..081885f488905e38eea25f2ada56a15fffb229c6 100644 (file)
@@ -1153,7 +1153,9 @@ static int ipgre_tunnel_init(struct net_device *dev)
        tunnel = (struct ip_tunnel*)dev->priv;
        iph = &tunnel->parms.iph;
 
-       tunnel->dev                     = dev;
+       tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
 
@@ -1215,6 +1217,9 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv;
        struct iphdr *iph = &tunnel->parms.iph;
 
+       tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        iph->version            = 4;
        iph->protocol           = IPPROTO_GRE;
        iph->ihl                = 5;
index 59c26022efc9a4e211fdf0f8934acfc49e8b0cdb..cfa33e90eff6c89b14d8455f8421f500e672d889 100644 (file)
@@ -805,7 +805,10 @@ static int ipip_tunnel_init(struct net_device *dev)
 
        tunnel = (struct ip_tunnel*)dev->priv;
        iph = &tunnel->parms.iph;
+
        tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
 
@@ -841,6 +844,9 @@ static int __init ipip_fb_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel = dev->priv;
        struct iphdr *iph = &tunnel->parms.iph;
 
+       tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        iph->version            = 4;
        iph->protocol           = IPPROTO_IPIP;
        iph->ihl                = 5;
index 4bbfa57a29cbd0b74ffab9688e7631e4190f73b4..8d34af7550fffe80574ddd7fe3c228de0792db44 100644 (file)
@@ -743,7 +743,10 @@ static int ipip6_tunnel_init(struct net_device *dev)
 
        tunnel = (struct ip_tunnel*)dev->priv;
        iph = &tunnel->parms.iph;
+
        tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
        memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
 
@@ -780,6 +783,9 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel = dev->priv;
        struct iphdr *iph = &tunnel->parms.iph;
 
+       tunnel->dev = dev;
+       strcpy(tunnel->parms.name, dev->name);
+
        iph->version            = 4;
        iph->protocol           = IPPROTO_IPV6;
        iph->ihl                = 5;