How does rpc.lockd know where to send a request

M. Warner Losh imp at
Sun Feb 7 04:09:24 UTC 2010

In message: <4B6E2B40.1070405 at>
            Julian Elischer <julian at> writes:
: M. Warner Losh wrote:
: > I have a problem.  All systems are running freebsd-current form
: > sometime in the last month, although similar systems running
: > 8.0-RELEASE exhibit exactly the same problem.  rpc.lockd on an NFS
: > client is doing something that baffles my mind entirely, maybe you can
: > help.  Please bear with me, this is a little complicated, but I wanted
: > to include all the details.
: > I have a host, let's call it dune.  dune is at  dune is also
: > the master for the carp interface  It is running rpc.lockd
: > and is an nfs server.  I've told nfs, rpcbind, lockd and statd to only
: > listen on address
: > I have a second host.  maud-dib is  I do "mount
: > /dune" on maud-dib.  Wireshark shows all the traffic
: > going to  All is happy in the world.  When I start, there's
: > no ARP entry for on, nor is there after the mount.
: > Until I do the following 'lockf /dune/imp/junk ls' (I have write perms
: > to /dune/imp).  At this point, rpc.lockd hangs.  I get the message
: > " lockd not responding" which seems odd.  lockd is
: > really there.  However, wireshark shows the NLM traffic going to IP
: > address  maud-dib has no carp interfaces.
: > That's odd.  So my question is 'how does lockd know where to go to
: > talk the NLM protocol?'
: > 
: my recollection is that maud-dib will sent an initial packet to dune
: and dune will respond but that the response may come from,
: after which maud-dib will redirect all requests there, which will not
: work because dune is not listenning there.

But wouldn't the response from mean I could search for the
hex string and see 0a000005 in the packet header?

: teh problem is that dune's daemon is setting a local address of
: IPADDR_ANY ( which tells the packets to use a from
: address that is the address ofthe interface that they exit from.

No, dune's daemon is sitting on

: Since is the primary address on that interface, that gets
: selected.
: you may try some trickery where you add the .5 address AFTER the .99
: address so that the .99 is the primary address.

Normally, I'd believe you.  But since there's nothing listening on the
* address, and also nothing listening on the address, I'm
less sure.  After looking at the wireshark dump, I don't see any packets until the ARP for it near the end of the trace. if you are interested.

This is a good theory, and I'll have to look into it deeper.


: > I did a packet capture from before I did the mount on maud-dib.  I can
: > see the NFS mount, the NFS traffic, all to  I then see an
: > ARP for, followed by the NLM request from to
: >  This gets an ICMP port unreachable message, since I told
: > nfs, et al, to bind only to
: > So, I thought, 'the answer is obvious, I'll just look for the packet
: > that has the string 'dune' in it (which is the hostname of
: > No packets have that string in it, other than the mount packet which
: > has /dune in it.  Nor is there any DNS activity doing a lookup.  Nor
: > is there any static mapping in /etc/hosts on
: > Next thought: Oh, somebody like portmapper or the NFS protocol from
: > is telling's rpc.lockd (or something else) to do
: > locking requests to  That's trivial to find, I think to
: > myself.  I'll look for the octets 0a 00 00 05 (hex).  The only
: > instances of that are in the ARP packet, the NLM request and the ICMP
: > unreachable packets.  No other packets includes these bytes.  Nor do
: > any include the reverse.
: > Right after the mount, there's nothing in the connection table that
: > points to, only
: > So I'm having a serious WTF moment.  How the heck is this even
: > possible.  Any ideas on where to look for where this gets set and/or
: > communicated?
: > thanks a bunch for any insight that you can give...
: > Warner
: > _______________________________________________
: > freebsd-net at mailing list
: >
: > To unsubscribe, send any mail to "freebsd-net-unsubscribe at"

More information about the freebsd-net mailing list