svn commit: r193674 - head/usr.sbin/mountd

Alexander Kabaev kan at FreeBSD.org
Mon Jun 8 03:15:28 UTC 2009


Author: kan
Date: Mon Jun  8 03:15:27 2009
New Revision: 193674
URL: http://svn.freebsd.org/changeset/base/193674

Log:
  The change r192913 has added dependency on IP_RECVDSTADDR being
  set for RPC UDP sockets. Mountd uses internal libc fuctions
  directly and bypasses generic socket initialization completely,
  so we need to set IP_RECVDSTADDR here to match the libc behavior.

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==============================================================================
--- head/usr.sbin/mountd/mountd.c	Mon Jun  8 02:13:24 2009	(r193673)
+++ head/usr.sbin/mountd/mountd.c	Mon Jun  8 03:15:27 2009	(r193674)
@@ -568,6 +568,13 @@ create_service(struct netconfig *nconf)
 					continue;
 				}
 			}
+			if (si.si_socktype == SOCK_DGRAM &&
+			    setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &one,
+			        sizeof one) < 0) {
+				syslog(LOG_ERR,
+				    "can't disable v4-in-v6 on IPv6 socket");
+				exit(1);
+			}
 			break;
 		case AF_INET6:
 			if (inet_pton(AF_INET6, hosts[nhostsbak],


More information about the svn-src-head mailing list