misc/117711: rpcbind binds to all interfaces on random ports even when using the -h flag

Remko Lodder remko at FreeBSD.org
Wed Oct 31 04:10:02 PDT 2007


The following reply was made to PR kern/117711; it has been noted by GNATS.

From: Remko Lodder <remko at FreeBSD.org>
To: Carlos Eduardo Monti <slaytanic at gmail.com>
Cc: freebsd-gnats-submit at FreeBSD.org, 
 Matteo Riondato <matteo at freebsd.org>
Subject: Re: misc/117711: rpcbind binds to all interfaces on random ports
 even	when using the -h flag
Date: Wed, 31 Oct 2007 10:55:13 +0100

 Carlos Eduardo Monti wrote:
 >> Description:
 > rpcbind opens two sockets on all interfaces on random ports when specified the -h flag, one socket for udp4 and one for udp6.
 > 
 >> How-To-Repeat:
 > overnight# sockstat | grep rpcbind
 > overnight# rpcbind -h 192.168.0.3
 > overnight# sockstat | grep rpcbind
 > root     rpcbind    2696  4  udp6   *:*                   *:*
 > root     rpcbind    2696  5  stream /var/run/rpcbind.sock
 > root     rpcbind    2696  6  udp6   ::1:111               *:*
 > root     rpcbind    2696  7  udp6   *:*                   *:*
 > root     rpcbind    2696  8  udp6   *:617                 *:*
 > root     rpcbind    2696  9  tcp6   ::1:111               *:*
 > root     rpcbind    2696  10 tcp6   *:*                   *:*
 > root     rpcbind    2696  11 udp4   127.0.0.1:111         *:*
 > root     rpcbind    2696  12 udp4   192.168.0.3:111       *:*
 > root     rpcbind    2696  13 udp4   *:944                 *:*
 > root     rpcbind    2696  14 tcp4   127.0.0.1:111         *:*
 > root     rpcbind    2696  15 tcp4   192.168.0.3:111       *:*
 > overnight# killall rpcbind
 > overnight# rpcbind -h 192.168.0.3
 > overnight# sockstat | grep rpcbind
 > root     rpcbind    2701  4  udp6   *:*                   *:*
 > root     rpcbind    2701  5  stream /var/run/rpcbind.sock
 > root     rpcbind    2701  6  udp6   ::1:111               *:*
 > root     rpcbind    2701  7  udp6   *:*                   *:*
 > root     rpcbind    2701  8  udp6   *:943                 *:*
 > root     rpcbind    2701  9  tcp6   ::1:111               *:*
 > root     rpcbind    2701  10 tcp6   *:*                   *:*
 > root     rpcbind    2701  11 udp4   127.0.0.1:111         *:*
 > root     rpcbind    2701  12 udp4   192.168.0.3:111       *:*
 > root     rpcbind    2701  13 udp4   *:804                 *:*
 > root     rpcbind    2701  14 tcp4   127.0.0.1:111         *:*
 > root     rpcbind    2701  15 tcp4   192.168.0.3:111       *:*
 > 
 
 Isn't this just behaviour of RPCbind which selects some random sockets
 by default? the -h is used to bind it to a specific IP address, not to
 bind it to specific ports (as far as i can recall), so what you are
 printing is really what I would expect it to be.
 
 Matteo, you worked on this recently, can you shed a light on this? and
 if my reasoning above is correct, can you please close the ticket since
 it's desired behaviour?
 
 Thanks
 remko
 
 -- 
 Kind regards,
 
      Remko Lodder               ** remko at elvandar.org
      FreeBSD                    ** remko at FreeBSD.org
 
      /* Quis custodiet ipsos custodes */


More information about the freebsd-net mailing list