Skip to contentSkip to conversation

ipip.c & ip_gre.c (Add Tunnel return)

PATCH In review andrew may 2 participants 3 messages Sep 25, 2001

Subsystems (2)
lore
Share & tools
lore

andrew may

author
#0 lore raw

PATCH 1/1 ipip.c & ip_gre.c (Add Tunnel return)

I think the tunnel drivers should return the name of the device the tunnel add created. Currently the tunnel_lookup functions copy the name into the stack var in the ioctl function but the ioctl copies the parm from the tunnel device.

net/ipv4/ip_gre.c +1 -1
@@ -284,7 +284,7 @@
 		}
 		if (i==100)
 			goto failed;
-		memcpy(parms->name, dev->name, IFNAMSIZ);
+		memcpy(nt->parms.name, dev->name, IFNAMSIZ);
 	}
 	if (register_netdevice(dev) < 0)
 		goto failed;
net/ipv4/ipip.c +1 -1
diff -ur linux.org/net/ipv4/ipip.c linux/net/ipv4/ipip.c
@@ -255,7 +255,7 @@
 		}
 		if (i==100)
 			goto failed;
-		memcpy(parms->name, dev->name, IFNAMSIZ);
+		memcpy(nt->parms.name, dev->name, IFNAMSIZ);
 	}
 	if (register_netdevice(dev) < 0)
 		goto failed;
#1 lore raw

From: andrew may <[email protected]>
Date: Tue, 25 Sep 2001 15:26:28 -0700

I think the tunnel drivers should return the name of the device the tunnel add created. Currently the tunnel_lookup functions copy the name into the stack var in the ioctl function but the ioctl copies the parm from the tunnel device.

Hmmm, net/ipv6/sit.c already has the version you propose. :-))) Which one is correct?

Alexey, what do you think?

Franks a lot,
David S. Miller
[email protected]

#2 lore raw

From: "David S. Miller" <[email protected]>
Date: Tue, 25 Sep 2001 15:31:19 -0700 (PDT)

[ replying to self...]

Hmmm, net/ipv6/sit.c already has the version you propose. :-))) Which one is correct?

Alexey, what do you think?

Nevermind, it is clear that Andrew's patch is correct. I've applied it, thanks.

Franks a lot,
David S. Miller
[email protected]