Hello,
I noticed a couple of bugs(?) in sit.c, ip_gre.c and ipip.c introduced
in the alloc_netdev patches (csets 1.305.3.9, 1.305.3.10 and 1.1305.3.11).
This patch made against cset 1.384 fixes the following issues:
- tunnel dev pointer also set for fallback tunnels
- dev name copied back to tunnel parameters so names autogenerated by
kernel get correctly reported to userspace
Thanks,
Ville
diff -Nur linux-2.5.OLD/net/ipv4/ip_gre.c linux-2.5/net/ipv4/ip_gre.c
--- linux-2.5.OLD/net/ipv4/ip_gre.c Fri Jul 4 15:01:54 2003
+++ linux-2.5/net/ipv4/ip_gre.c Fri Jul 4 14:59:27 2003
@@ -1153,7 +1153,9 @@
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);
@@ -1214,6 +1216,9 @@
{
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;
diff -Nur linux-2.5.OLD/net/ipv4/ipip.c linux-2.5/net/ipv4/ipip.c
--- linux-2.5.OLD/net/ipv4/ipip.c Fri Jul 4 15:01:54 2003
+++ linux-2.5/net/ipv4/ipip.c Fri Jul 4 14:59:27 2003
@@ -805,7 +805,10 @@
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);
@@ -840,6 +843,9 @@
{
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;
diff -Nur linux-2.5.OLD/net/ipv6/sit.c linux-2.5/net/ipv6/sit.c
--- linux-2.5.OLD/net/ipv6/sit.c Fri Jul 4 15:01:55 2003
+++ linux-2.5/net/ipv6/sit.c Fri Jul 4 14:59:27 2003
@@ -743,7 +743,10 @@
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);
@@ -779,6 +782,9 @@
{
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;
--
Ville Nuorvala
Research Assistant, Institute of Digital Communications,
Helsinki University of Technology
email: vnuorval@xxxxxxxxxx, phone: +358 (0)9 451 5257
|