ip tunnel doesn't show warning or error
This is really strange behavior ..
root@garfield ~# ip tunnel add testing123 mode ipip remote 192.168.1.1 local 192.168.1.12
root@garfield ~# ip tunnel show
..
testing123: ip/ip remote 192.168.1.1 local 192.168.1.12 ttl inherit root@garfield ~# ip tunnel add testingabc mode ipip remote 192.168.1.1 local 192.168.1.12
root@garfield ~# echo $?
0
root@garfield ~# ip tunnel show
..
testing123: ip/ip remote 192.168.1.1 local 192.168.1.12 ttl inherit
I guess the second tunnel add should end up with an error, but ioctl doesn't report anything on this ..
Signature · 1 line
Radek Vokál <[email protected]>
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 15 lines · Radek Vokál
This is really strange behavior ..
root@garfield ~# ip tunnel add testing123 mode ipip remote 192.168.1.1 local 192.168.1.12
root@garfield ~# ip tunnel show
..
testing123: ip/ip remote 192.168.1.1 local 192.168.1.12 ttl inherit root@garfield ~# ip tunnel add testingabc mode ipip remote 192.168.1.1 local 192.168.1.12
root@garfield ~# echo $?
0
root@garfield ~# ip tunnel show
..
testing123: ip/ip remote 192.168.1.1 local 192.168.1.12 ttl inherit
Quoted 3 lines
I guess the second tunnel add should end up with an error, but ioctl doesn't report anything on this ..
Here's small patch to show at least some warning
--- iproute2-051007/ip/iptunnel.c.old 2005-02-10 19:31:18.000000000
+0100
+++ iproute2-051007/ip/iptunnel.c 2005-10-31 11:03:04.000000000 +0100
@@ -130,7 +130,8 @@ static int do_add_ioctl(int cmd, const c
struct ifreq ifr;
int fd;
int err;
-
+ char old_name[IFNAMSIZ];
+ strncpy(old_name,p->name,IFNAMSIZ);
if (cmd == SIOCCHGTUNNEL && p->name[0])
strncpy(ifr.ifr_name, p->name, IFNAMSIZ);
else
@@ -138,6 +139,10 @@ static int do_add_ioctl(int cmd, const c
ifr.ifr_ifru.ifru_data = (void*)p;
fd = socket(AF_INET, SOCK_DGRAM, 0);
err = ioctl(fd, cmd, &ifr);
+ if (strncmp(ifr.ifr_data,old_name,IFNAMSIZ)) {
+ fprintf(stderr,"Warning: Tunnel already exists (%
s)\n",ifr.ifr_data);
+ }
if (err)
perror("ioctl");
close(fd);
Signature · 1 line
Radek Vokál <[email protected]>
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc