Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2013 14:56:40 GMT
From:      Fabian Wenk <fabian@wenks.ch>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/177781: rpc.statd / rpc.lockd do not start when used with -p option and ipv6_ipv4mapping="YES" is set in /etc/rc.conf
Message-ID:  <201304111456.r3BEueRe020973@red.freebsd.org>
Resent-Message-ID: <201304111500.r3BF01Wn030843@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         177781
>Category:       bin
>Synopsis:       rpc.statd / rpc.lockd do not start when used with -p option and ipv6_ipv4mapping="YES" is set in /etc/rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 11 15:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Fabian Wenk
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
>Environment:
FreeBSD batman.home4u.ch 9.1-RELEASE-p1 FreeBSD 9.1-RELEASE-p1 #0 r248931: Sat Mar 30 18:07:14 CET 2013     root@batman.home4u.ch:/usr/obj/usr/src/sys/BATMAN  amd64
>Description:
After the upgrade from FreeBSD 7.4 to 9.1 during system boot statd / lockd report the following errors and do not start:

Apr  3 02:19:45 batman rpc.statd: bindresvport_sa: Address already in use
Apr  3 02:19:45 batman kernel: Starting statd.Apr  3 02:19:45 batman root: /etc/rc: WARNING: failed to start statd
Apr  3 02:19:45 batman rpc.lockd: Starting
Apr  3 02:19:45 batman kernel: /etc/rc: WARNING: failed to start statd
Apr  3 02:19:45 batman kernel: Starting lockd.
Apr  3 02:19:45 batman kernel: NLM: failed to contact remote rpcbind, stat = 0, port = 0
Apr  3 02:19:45 batman kernel: NLM: failed to contact remote rpcbind, stat = 0, port = 0
Apr  3 02:19:45 batman kernel: Can't start NLM - unable to contact NSM

The same errors are logged when /etc/rc.d/statd is run manually:

Apr  3 02:21:18 batman rpc.statd: bindresvport_sa: Address already in use
Apr  3 02:21:18 batman root: /etc/rc.d/statd: WARNING: failed to start statd


Relevant configuration in /etc/rc.conf (two interfaces, one with multiple IP addresses):

# IPv4
ifconfig_em0="inet 62.12.173.2 netmask 255.255.255.224"
ifconfig_em0_alias0="inet 192.168.1.2 netmask 255.255.255.0"
ifconfig_em0_alias1="inet 62.12.173.11 netmask 255.255.255.255"
ifconfig_em1="inet 62.2.85.178 netmask 255.255.255.240"
defaultrouter="62.12.173.1"
gateway_enable="YES"

# IPv6
ip6addrctl_policy="ipv6_prefer"
ipv6_ipv4mapping="YES"          # Set to "YES" to enable IPv4 mapped IPv6 addr communication. (like ::ffff:a.b.c.d)
ifconfig_em0_ipv6="inet6 2001:8a8:1005:1::2 prefixlen 64"
ifconfig_em0_alias2="inet6 2001:8a8:1005:1::11 prefixlen 64"
ifconfig_em1_ipv6="inet6 2001:8a8:1005:2::178 prefixlen 64"
ipv6_defaultrouter="2001:8a8:1005:1::1"
ipv6_gateway_enable="YES"
# IPv6 6to4 gateway
stf_interface_ipv4addr="62.12.173.2"
# IPv6 router advertisement
rtadvd_enable="YES"
rtadvd_interfaces="em0 em1"

# NFS
rpcbind_enable="YES"
nfs_client_enable="YES"
rpc_lockd_enable="YES"
rpc_lockd_flags="-p 4045"
rpc_statd_enable="YES"
rpc_statd_flags="-p 4046"


With the following workaround I could start statd / lockd manually:
sysctl net.inet6.ip6.v6only=0
/etc/rc.d/statd start
/etc/rc.d/lockd start
sysctl net.inet6.ip6.v6only=1


And statd / lockd are running as they should:

root@batman:~ # rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  rpcbind
    100000    3   tcp    111  rpcbind
    100000    2   tcp    111  rpcbind
    100000    4   udp    111  rpcbind
    100000    3   udp    111  rpcbind
    100000    2   udp    111  rpcbind
    100000    4 local    111  rpcbind
    100000    3 local    111  rpcbind
    100000    2 local    111  rpcbind
    300019    1   tcp    795  amd
    300019    1   udp    970  amd
    100024    1   udp   4046  status
    100024    1   tcp   4046  status
    100021    0   udp   4045  nlockmgr
    100021    0   tcp   4045  nlockmgr
    100021    1   udp   4045  nlockmgr
    100021    1   tcp   4045  nlockmgr
    100021    3   udp   4045  nlockmgr
    100021    3   tcp   4045  nlockmgr
    100021    4   udp   4045  nlockmgr
    100021    4   tcp   4045  nlockmgr
root@batman:~ # netstat -an |grep 4045
tcp4       0      0 *.4045                 *.*                    LISTEN
tcp6       0      0 *.4045                 *.*                    LISTEN
udp4       0      0 *.4045                 *.*                    
udp6       0      0 *.4045                 *.*                    
root@batman:~ # netstat -an |grep 4046
tcp4       0      0 *.4046                 *.*                    LISTEN
tcp6       0      0 *.4046                 *.*                    LISTEN
udp4       0      0 *.4046                 *.*                    
udp6       0      0 *.4046                 *.*                    
root@batman:~ # 


For a test I remove (disable) the rpc_statd_flags and rpc_lockd_flags lines in /etc/rc.conf, so that a random port is used. But then statd / lockd was only listening on IPv4 and not on IPv6.
>How-To-Repeat:
Set the following options in /etc/rc.conf (with IPv6 enabled and configured):

ipv6_ipv4mapping="YES"
rpcbind_enable="YES"
nfs_client_enable="YES"
rpc_lockd_enable="YES"
rpc_lockd_flags="-p 4045"
rpc_statd_enable="YES"
rpc_statd_flags="-p 4046"

and reboot, or use the following commands:
sysctl net.inet6.ip6.v6only=1
/etc/rc.d/statd start
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304111456.r3BEueRe020973>