diff options
Diffstat (limited to 'lib/libc/rpc/svc_generic.c')
-rw-r--r-- | lib/libc/rpc/svc_generic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc/rpc/svc_generic.c b/lib/libc/rpc/svc_generic.c index 7f6cfb8..574994d 100644 --- a/lib/libc/rpc/svc_generic.c +++ b/lib/libc/rpc/svc_generic.c @@ -199,6 +199,7 @@ svc_tli_create(fd, nconf, bindaddr, sendsz, recvsz) struct __rpc_sockinfo si; struct sockaddr_storage ss; socklen_t slen; + static const uint32_t true_value = 1; if (fd == RPC_ANYFD) { if (nconf == NULL) { @@ -225,6 +226,14 @@ svc_tli_create(fd, nconf, bindaddr, sendsz, recvsz) } } + if (si.si_af == AF_INET && si.si_socktype == SOCK_DGRAM) { + if (_setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, + &true_value, sizeof(true_value))) { + warnx("svc_tli_create: cannot set IP_RECVDSTADDR"); + return (NULL); + } + } + /* * If the fd is unbound, try to bind it. */ |