rpms/iproute/devel iproute2-051007-add_tunnel.patch, NONE, 1.1 iproute.spec, 1.36, 1.37

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 31 10:09:54 UTC 2005


Author: rvokal

Update of /cvs/dist/rpms/iproute/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv8753

Modified Files:
	iproute.spec 
Added Files:
	iproute2-051007-add_tunnel.patch 
Log Message:
- add warning to ip tunnel add command (#128107)

iproute2-051007-add_tunnel.patch:
 iptunnel.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

--- NEW FILE iproute2-051007-add_tunnel.patch ---
--- 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);
+	    return 1;
+	}
 	if (err)
 		perror("ioctl");
 	close(fd);


Index: iproute.spec
===================================================================
RCS file: /cvs/dist/rpms/iproute/devel/iproute.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- iproute.spec	8 Oct 2005 02:16:41 -0000	1.36
+++ iproute.spec	31 Oct 2005 10:09:51 -0000	1.37
@@ -4,10 +4,10 @@
 Summary: Advanced IP routing and network device configuration tools.
 Name: iproute
 Version: 2.6.14
-Release: 6
+Release: 7
 Group: Applications/System
 Source: http://developer.osdl.org/dev/iproute2/download/iproute2-%{date_version}.tar.gz
-URL:    http://developer.osdl.org/dev/iproute2/
+URL:	http://linux-net.osdl.org/index.php/Iproute2
 Source1: ip.8
 Source2: tc.8
 Source3: tc-cbq.8
@@ -27,6 +27,7 @@
 Patch3: cbq-0.7.1-avpkt-enhancement.patch
 Patch5: iproute2-ss050901-opt_flags.patch
 Patch6: iproute2-ss050901-host_len.patch
+Patch7: iproute2-051007-add_tunnel.patch
 
 License: GNU GPL
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -45,6 +46,7 @@
 %patch3 -p0 -b .avpkt-enhancment
 %patch5 -p1 -b .opt_flags
 %patch6 -p1 -b .host_len
+%patch7 -p1 -b .tunnel_add
 
 %build
 make
@@ -114,6 +116,9 @@
 %config(noreplace) /etc/sysconfig/cbq/*
 
 %changelog
+* Mon Oct 31 2005 Radek Vokal <rvokal at redhat.com> 2.6.14-7
+- add warning to ip tunnel add command (#128107)
+
 * Fri Oct 07 2005 Bill Nottingham <notting at redhat.com> 2.6.14-6
 - update from upstream (appears to fix #170111)
 




More information about the fedora-cvs-commits mailing list