Bug 213729 - showmount doesn't work with IPv6
Summary: showmount doesn't work with IPv6
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-23 14:12 UTC by Jason Mader
Modified: 2016-10-24 21:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2016-10-23 14:12:08 UTC
`showmount -e` doesn’t work when `rpcbind -6`.

getsockname(4,{ AF_INET6 [::]:998 },0x7fffffffd554) = 0 (0x0)
getsockopt(0x4,0xffff,0x1008,0x7fffffffd550,0x7fffffffd554) = 0 (0x0)
getpid()					 = 22517 (0x57f5)
ioctl(4,FIONBIO,0xffffd634)			 = 0 (0x0)
kqueue()					 = 5 (0x5)
sendto(4,"X\b\M-a\M-k\0\0\0\0\0\0\0\^B\0"...,76,0x0,{ AF_INET6 [::1]:111 },0x1c) = 76 (0x4c)
kevent(5,{ 4,EVFILT_READ,EV_ADD,0x0,0x0,0x0 },1,{ },1,{ 15.000000000 }) = 0 (0x0)
sendto(4,"X\b\M-a\M-k\0\0\0\0\0\0\0\^B\0"...,76,0x0,{ AF_INET6 [::1]:111 },0x1c) = 76 (0x4c)
kevent(5,{ },0,{ },1,{ 29.889481000 })		 = 0 (0x0)
sendto(4,"X\b\M-a\M-k\0\0\0\0\0\0\0\^B\0"...,76,0x0,{ AF_INET6 [::1]:111 },0x1c) = 76 (0x4c)
kevent(5,{ },0,{ },1,{ 14.768469000 })		 = 0 (0x0)
close(5)					 = 0 (0x0)
Comment 1 Alan Somers freebsd_committer freebsd_triage 2016-10-23 18:03:50 UTC
It works for me when rpcbind binds to both IPv4 and IPv6, and I specify an IPv6 addr to showmount.  Please show the exact command line used by both rpcbind and showmount, and the ifconfig output on both client and server.  Also, show the output of "showmount -e".
Comment 2 Jason Mader 2016-10-23 18:27:34 UTC
root 94263   0.0  0.0  10424  1932  -  Ss   14:06      0:00.02 /usr/sbin/rpcbind -6

There is no output to `showmount -e` because it hangs.

You tested what works, which is `rpcbind` without `-6` when it binds to IPv4 and IPv6 both. When it only binds to IPv6, then from on the same host `showmount -e` does not work.
Comment 3 Alan Somers freebsd_committer freebsd_triage 2016-10-23 18:31:14 UTC
Please post the output of ifconfig on both client and server as well.  And if you have a firewall enabled, post its ruleset, too.
Comment 4 Jason Mader 2016-10-23 19:08:01 UTC
$ ifconfig -a
cxl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9198
	options=880523<RXCSUM,TXCSUM,JUMBO_MTU,TSO4,LRO,LINKSTATE>
	ether 00:07:43:36:ca:00
	inet 10.141.254.2 netmask 0xffff0000 broadcast 10.141.255.255
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet 10Gbase-Twinax <full-duplex>
	status: active
cxl1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	ether 00:07:43:36:ca:08
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet 10Gbase-Twinax <full-duplex>
	status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
	inet 127.0.0.1 netmask 0xff000000
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
	groups: lo

But, again, I am running `showmount -e` on the same host about that is running `rpcbind -6`.

   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               rpcbind    superuser
    100000    3    tcp6      ::.0.111               rpcbind    superuser
    100000    4    udp6      ::.0.111               rpcbind    superuser
    100000    3    udp6      ::.0.111               rpcbind    superuser
    100000    4    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    3    local     /var/run/rpcbind.sock  rpcbind    superuser
    100000    2    local     /var/run/rpcbind.sock  rpcbind    superuser
    100005    1    udp6      ::.2.174               mountd     superuser
    100005    3    udp6      ::.2.174               mountd     superuser
    100005    1    tcp6      ::.2.174               mountd     superuser
    100005    3    tcp6      ::.2.174               mountd     superuser
    100005    1    udp       0.0.0.0.2.174          mountd     superuser
    100005    3    udp       0.0.0.0.2.174          mountd     superuser
    100005    1    tcp       0.0.0.0.2.174          mountd     superuser
    100005    3    tcp       0.0.0.0.2.174          mountd     superuser
    100003    2    tcp       0.0.0.0.8.1            nfs        superuser
    100003    3    tcp       0.0.0.0.8.1            nfs        superuser
    100003    2    tcp6      ::.8.1                 nfs        superuser
    100003    3    tcp6      ::.8.1                 nfs        superuser

USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
root     sshd       49424 3  tcp4   10.141.254.2:22       10.141.255.254:38860
root     sshd       3916  3  tcp4   10.141.254.2:22       *:*
root     nfsd       19504 5  tcp4   *:2049                *:*
root     nfsd       19504 6  tcp6   *:2049                *:*
root     mountd     11220 5  udp6   ::1:686               *:*
root     mountd     11220 6  tcp6   ::1:686               *:*
root     mountd     11220 7  udp4   127.0.0.1:686         *:*
root     mountd     11220 8  tcp4   127.0.0.1:686         *:*
root     rpcbind    72125 4  udp6   *:*                   *:*
root     rpcbind    72125 5  stream /var/run/rpcbind.sock
root     rpcbind    72125 6  udp6   *:111                 *:*
root     rpcbind    72125 7  udp6   *:947                 *:*
root     rpcbind    72125 8  tcp6   *:111                 *:*
root     nfsuserd   27059 3  udp4   *:746                 *:*
root     nfsuserd   22349 3  udp4   *:746                 *:*
root     nfsuserd   22313 3  udp4   *:746                 *:*
root     nfsuserd   21219 3  udp4   *:746                 *:*
root     nfsuserd   16437 3  udp4   *:746                 *:*
root     syslogd    51206 4  dgram  /var/run/log
root     syslogd    51206 5  dgram  /var/run/logpriv
root     devd       56543 4  stream /var/run/devd.pipe
root     devd       56543 5  seqpac /var/run/devd.seqpacket.pipe
root     devd       56543 7  dgram  -> /var/run/logpriv
Comment 5 Alan Somers freebsd_committer freebsd_triage 2016-10-24 21:25:42 UTC
Everything is working as designed.  First, note that "showmount -e ::1" returns immediately.  Second, note that "showmount -e" will return eventually, but it takes 2 minutes to timeout.  You probably didn't give it the full two minutes before.

What's going on is that if you don't specify "::1" then showmount assumes you meant "localhost", and it tries to find the best way to talk to localhost.  It will try both ::1 and 127.0.0.1 with both tcp and udp.  But since udp is connectionless, it has no way of knowing whether rpcbind is listening except by waiting for the full timeout period.

The timeout is adjustable in the RPC library (using the undocumented __rpc_control), but showmount currently uses the default.  Does that solve your problem?
Comment 6 Jason Mader 2016-10-24 21:44:12 UTC
I suppose, if that’s the design. Though it just seems that maybe the design could be improved so that it returns quickly when `rpcbind -6`. Note, my `showmount -e ::1` doesn’t return immediately — takes the full 2 minutes.