SOURCES: iputils-syserror.patch (NEW), iputils-bindnow.patch (NEW)...

glen glen at pld-linux.org
Tue Mar 14 14:10:10 CET 2006


Author: glen                         Date: Tue Mar 14 13:10:10 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- gentoo patches

---- Files affected:
SOURCES:
   iputils-syserror.patch (NONE -> 1.1)  (NEW), iputils-bindnow.patch (NONE -> 1.1)  (NEW), iputils-gcc34.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/iputils-syserror.patch
diff -u /dev/null SOURCES/iputils-syserror.patch:1.1
--- /dev/null	Tue Mar 14 14:10:10 2006
+++ SOURCES/iputils-syserror.patch	Tue Mar 14 14:10:05 2006
@@ -0,0 +1,9 @@
+--- iputils/rdisc.c.orig	2005-01-03 22:53:27.852431840 -0500
++++ iputils/rdisc.c	2005-01-03 22:53:27.864430016 -0500
+@@ -1504,5 +1504,5 @@
+ 	if (logging)
+ 		syslog(LOG_ERR, "%s: %m", str);
+ 	else
+-		(void) fprintf(stderr, "%s: %s\n", str, sys_errlist[errno]);
++		(void) fprintf(stderr, "%s: %s\n", str, strerror(errno));
+ }

================================================================
Index: SOURCES/iputils-bindnow.patch
diff -u /dev/null SOURCES/iputils-bindnow.patch:1.1
--- /dev/null	Tue Mar 14 14:10:10 2006
+++ SOURCES/iputils-bindnow.patch	Tue Mar 14 14:10:05 2006
@@ -0,0 +1,16 @@
+Since these binaries are going to be setuid root, we want 
+don't want to allow lazy bindings, otherwise we allow some 
+information leakage.
+
+http://bugs.gentoo.org/77526
+
+--- Makefile
++++ Makefile
+@@ -39,3 +39,7 @@
+ ping: ping.o ping_common.o
++	$(LINK.o) $^ $(LDLIBS) -o $@ -Wl,-z,now -Wl,-z,relro
+ ping6: ping6.o ping_common.o
++	$(LINK.o) $^ $(LDLIBS) -o $@ -Wl,-z,now -Wl,-z,relro
++traceroute6: traceroute6.o
++	$(LINK.o) $^ $(LDLIBS) -o $@ -Wl,-z,now -Wl,-z,relro
+ ping.o ping6.o ping_common.o: ping_common.h

================================================================
Index: SOURCES/iputils-gcc34.patch
diff -u /dev/null SOURCES/iputils-gcc34.patch:1.1
--- /dev/null	Tue Mar 14 14:10:10 2006
+++ SOURCES/iputils-gcc34.patch	Tue Mar 14 14:10:05 2006
@@ -0,0 +1,134 @@
+iputils has a lot of ugly goto's that break when using 
+large gcc inline-limits.
+
+Fixes by Robert Moss and Dave Stahl
+http://bugs.gentoo.org/49241
+http://bugs.gentoo.org/80969
+
+--- iputils/tracepath.c
++++ iputils/tracepath.c
+@@ -76,7 +76,7 @@
+ 	int progress = -1;
+ 	int broken_router;
+ 	
+-restart:
++       while (1) {
+ 	memset(&rcvbuf, -1, sizeof(rcvbuf));
+ 	iov.iov_base = &rcvbuf;
+ 	iov.iov_len = sizeof(rcvbuf);
+@@ -93,7 +93,7 @@
+ 	if (res < 0) {
+ 		if (errno == EAGAIN)
+ 			return progress;
+-		goto restart;
++		continue;
+ 	}
+ 
+ 	progress = mtu;
+@@ -216,7 +216,7 @@
+ 		perror("NET ERROR");
+ 		return 0;
+ 	}
+-	goto restart;
++       }
+ }
+ 
+ int probe_ttl(int fd, int ttl)
+@@ -227,7 +227,6 @@
+ 
+ 	memset(sndbuf,0,mtu);
+ 
+-restart:
+ 	for (i=0; i<10; i++) {
+ 		int res;
+ 
+@@ -243,7 +242,8 @@
+ 		if (res==0)
+ 			return 0;
+ 		if (res > 0)
+-			goto restart;
++			i = 0;
++			continue;
+ 	}
+ 	hisptr = (hisptr + 1)&63;
+ 
+--- iputils/tracepath6.c
++++ iputils/tracepath6.c
+@@ -66,7 +66,7 @@
+ 	int progress = -1;
+ 	int broken_router;
+ 
+-restart:
++       while (1) {
+ 	memset(&rcvbuf, -1, sizeof(rcvbuf));
+ 	iov.iov_base = &rcvbuf;
+ 	iov.iov_len = sizeof(rcvbuf);
+@@ -83,7 +83,7 @@
+ 	if (res < 0) {
+ 		if (errno == EAGAIN)
+ 			return progress;
+-		goto restart;
++		continue;
+ 	}
+ 
+ 	progress = 2;
+@@ -222,34 +222,29 @@
+ 		perror("NET ERROR");
+ 		return 0;
+ 	}
+-	goto restart;
++       }
+ }
+ 
+ int probe_ttl(int fd, int ttl)
+ {
+-	int i;
++	int i=0, res;
+ 	char sndbuf[mtu];
+ 	struct probehdr *hdr = (struct probehdr*)sndbuf;
+ 
+-restart:
+-
+-	for (i=0; i<10; i++) {
+-		int res;
+-
+-		hdr->ttl = ttl;
+-		gettimeofday(&hdr->tv, NULL);
+-		if (send(fd, sndbuf, mtu-overhead, 0) > 0)
+-			break;
+-		res = recverr(fd, ttl);
+-		if (res==0)
+-			return 0;
+-		if (res > 0)
+-			goto restart;
+-	}
+-
+-	if (i<10) {
+-		int res;
+-
++	while (i<10) {
++		for (i=0; i<10; i++) {
++			hdr->ttl = ttl;
++			gettimeofday(&hdr->tv, NULL);
++			if (send(fd, sndbuf, mtu-overhead, 0) > 0)
++				break;
++			res = recverr(fd, ttl);
++			if (res==0)
++				return 0;
++			if (res > 0) {
++				i = 0;
++				continue;
++			}
++		}
+ 		data_wait(fd);
+ 		if (recv(fd, sndbuf, sizeof(sndbuf), MSG_DONTWAIT) > 0) {
+ 			printf("%2d?: reply received 8)\n", ttl);
+@@ -257,7 +252,7 @@
+ 		}
+ 		res = recverr(fd, ttl);
+ 		if (res == 1)
+-			goto restart;
++			continue;
+ 		return res;
+ 	}
+ 
================================================================


More information about the pld-cvs-commit mailing list