Hi there,

I've recently encountered a problem that my NFS box was not directly
accessible to one of its clients.  I've forwarded TCP ports for the
rpcbind(8), mountd(8), and nfsd(8) with ssh(1), but mount_nfs(8) did
not work, that is, with -o tcp,proto=tcp.

Running it under truss(1) revealed something odd:

    socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP) = 3 (0x3)
    ...
    sendto(3,"blah-blah"...,56,0,{ AF_INET <ip-address>:111 },16) = 56 (0x38)
    <hangs here>

Only after I've forwarded port 111 via UDP, it worked as expected.
Apparently, this happens inside rpcb_getaddr(3), and there is no easy
way to create SOCK_STREAM/IPPROTO_TCP socket, which kind of prevents
working with NFSv3 in a pure TCP environment, as forcing TCP mounts via
-o tcp,proto=tcp is useless, per /usr/src/lib/libc/rpc/rpcb_clnt.c:

...
#ifdef PORTMAP
        ...
        /*
         * Try UDP only - there are some portmappers out
         * there that use UDP only.
         */

Is there a reason for this behavior (apart from what the comment says,
ignoring the fact that it is 2019 now), and more importantly, correct
way to avoid talking to the rpcbind(8) via UDP?

./danfe
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to