summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2009-06-08 03:15:27 +0000
committerkan <kan@FreeBSD.org>2009-06-08 03:15:27 +0000
commitd928fef9cef4028c64c41381600621e962d11893 (patch)
treed8478eb6f5daf42a816c325c0c2035bc03ad59c7 /usr.sbin
parent87bc9febc24f4075ea6e618177947dbcd8c0a353 (diff)
downloadFreeBSD-src-d928fef9cef4028c64c41381600621e962d11893.zip
FreeBSD-src-d928fef9cef4028c64c41381600621e962d11893.tar.gz
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/mountd/mountd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 6977b93..0c19a2b 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -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],
OpenPOWER on IntegriCloud