SOURCES: libtirpc-svc-rtaddr.patch (NEW), libtirpc-svc-run.patch (...

baggins baggins at pld-linux.org
Tue Sep 25 18:22:24 CEST 2007


Author: baggins                      Date: Tue Sep 25 16:22:23 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- design fixes, correct IP4/6 addresses processing

---- Files affected:
SOURCES:
   libtirpc-svc-rtaddr.patch (NONE -> 1.1)  (NEW), libtirpc-svc-run.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/libtirpc-svc-rtaddr.patch
diff -u /dev/null SOURCES/libtirpc-svc-rtaddr.patch:1.1
--- /dev/null	Tue Sep 25 18:22:23 2007
+++ SOURCES/libtirpc-svc-rtaddr.patch	Tue Sep 25 18:22:18 2007
@@ -0,0 +1,52 @@
+commit f8ff8f0de33606ff544dc87c0a9993fd3a0f5475
+Author: Steve Dickson <steved at redhat.com>
+Date:   Mon Jul 30 07:26:45 2007 -0400
+
+    - Make sure remote address (xp_rtaddr) is populated
+      with the correct type of address.
+    
+    Signed-off-by: Steve Dickson <steved at redhat.com>
+
+diff --git a/src/svc_vc.c b/src/svc_vc.c
+index 48494e1..3d77aef 100644
+--- a/src/svc_vc.c
++++ b/src/svc_vc.c
+@@ -239,7 +239,10 @@ svc_fd_create(fd, sendsize, recvsize)
+ 		warnx("svc_fd_create: no mem for local addr");
+ 		goto freedata;
+ 	}
+-	memcpy(ret->xp_rtaddr.buf, &sin6, (size_t)sizeof(ss));
++	if (ss.ss_family == AF_INET)
++		memcpy(ret->xp_rtaddr.buf, &ss, (size_t)sizeof(ss));
++	else
++		memcpy(ret->xp_rtaddr.buf, &sin6, (size_t)sizeof(ss));
+ #ifdef PORTMAP
+ 	if (sin6.sin6_family == AF_INET6 || sin6.sin6_family == AF_LOCAL) {
+ 		memcpy(&ret->xp_raddr, ret->xp_rtaddr.buf,
+@@ -343,20 +346,23 @@ again:
+ 	newxprt = makefd_xprt(sock, r->sendsize, r->recvsize);
+ 	if (addr.ss_family == AF_INET) {
+ 		map_ipv4_to_ipv6((struct sockaddr_in *)&addr, &sin6);
+-		len = sizeof(struct sockaddr_in6);
+ 	} else {
+ 		memcpy(&sin6, &addr, len);
+ 	}
+ 	newxprt->xp_rtaddr.buf = mem_alloc(len);
+ 	if (newxprt->xp_rtaddr.buf == NULL)
+ 		return (FALSE);
+-	memcpy(newxprt->xp_rtaddr.buf, &sin6, len);
++
++	if (addr.ss_family == AF_INET)
++		memcpy(newxprt->xp_rtaddr.buf, &addr, len);
++	else
++		memcpy(newxprt->xp_rtaddr.buf, &sin6, len);
+ 	newxprt->xp_rtaddr.maxlen = newxprt->xp_rtaddr.len = len;
+ #ifdef PORTMAP
+ 	if (sin6.sin6_family == AF_INET6 || sin6.sin6_family == AF_LOCAL) {
+ 		memcpy(&newxprt->xp_raddr, newxprt->xp_rtaddr.buf,
+ 			sizeof(struct sockaddr_in6));
+-		newxprt->xp_addrlen = len;
++		newxprt->xp_addrlen = sizeof(struct sockaddr_in6);
+ 	}
+ #endif				/* PORTMAP */
+ 	if (__rpc_fd2sockinfo(sock, &si) && si.si_proto == IPPROTO_TCP) {

================================================================
Index: SOURCES/libtirpc-svc-run.patch
diff -u /dev/null SOURCES/libtirpc-svc-run.patch:1.1
--- /dev/null	Tue Sep 25 18:22:23 2007
+++ SOURCES/libtirpc-svc-run.patch	Tue Sep 25 18:22:18 2007
@@ -0,0 +1,19 @@
+--- libtirpc-0.1.7/src/svc_run.c.orig	2005-05-18 01:10:50.000000000 -0400
++++ libtirpc-0.1.7/src/svc_run.c	2007-07-09 12:52:23.000000000 -0400
+@@ -51,14 +51,14 @@ svc_run()
+ 	struct timeval timeout;
+ 	extern rwlock_t svc_fd_lock;
+ 
+-	timeout.tv_sec = 30;
+-	timeout.tv_usec = 0;
+ 
+ 	for (;;) {
+ 		rwlock_rdlock(&svc_fd_lock);
+ 		readfds = svc_fdset;
+ 		cleanfds = svc_fdset;
+ 		rwlock_unlock(&svc_fd_lock);
++		timeout.tv_sec = 30;
++		timeout.tv_usec = 0;
+ 		switch (select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) {
+ 		case -1:
+ 			FD_ZERO(&readfds);
================================================================


More information about the pld-cvs-commit mailing list