From d928fef9cef4028c64c41381600621e962d11893 Mon Sep 17 00:00:00 2001 From: kan Date: Mon, 8 Jun 2009 03:15:27 +0000 Subject: 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. --- usr.sbin/mountd/mountd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr.sbin/mountd') 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], -- cgit v1.1