diff options
author | rstone <rstone@FreeBSD.org> | 2015-01-19 00:33:32 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2015-01-19 00:33:32 +0000 |
commit | cb3a27ad28c1f0dde8ed5051245175152b16ce26 (patch) | |
tree | a7a15ce20397f238278b27cba9e47b639c604aae /usr.sbin/rpc.lockd | |
parent | 3d07512cea65fe9d6ebf2e47235c5d3b0577fbb5 (diff) | |
download | FreeBSD-src-cb3a27ad28c1f0dde8ed5051245175152b16ce26.zip FreeBSD-src-cb3a27ad28c1f0dde8ed5051245175152b16ce26.tar.gz |
When mountd is creating sockets, it iterates over all addresses specified
in the "hosts" array and eventually looks up the network address with
getaddrinfo(). At one point it checks for a numeric address and if it
sees one, it sets a hint parameter to force getaddrinfo to interpret the
host as a numeric address. However that hint is not cleared for subsequent
iterations of the loop and if any hosts seen after this point are host names,
getaddrinfo will fail on the name. The result of this bug is that you cannot
pass a host name to the -h flag.
Unfortunately, the first iteration will either process ::1 or 127.0.0.1,
so the flag is set on the first iteration and all host names will fail
to be processed.
The same bug applies to rpc.lockd and rpc.statd, so fix them too.
Differential Revision: https://reviews.freebsd.org/D1507
Reported by: Dylan Martin
MFC after: 1 week
Sponsored by: Sandvine Inc.
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r-- | usr.sbin/rpc.lockd/lockd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 2974acb..4f1347e 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -518,7 +518,6 @@ create_service(struct netconfig *nconf) /* Get rpc.statd's address on this transport */ memset(&hints, 0, sizeof hints); - hints.ai_flags = AI_PASSIVE; hints.ai_family = si.si_af; hints.ai_socktype = si.si_socktype; hints.ai_protocol = si.si_proto; @@ -534,6 +533,7 @@ create_service(struct netconfig *nconf) out_of_mem(); sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */ mallocd_res = 0; + hints.ai_flags = AI_PASSIVE; /* * XXX - using RPC library internal functions. |