NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Local-only (non-ip) rpcbind(8)?



hf%spg.tu-darmstadt.de@localhost (Hauke Fath) writes:

>Hi,

>can rpcbind(8) be set up to only use local transport, as opposed to 
>binding to interfaces?

>The closest I seem to come to that goal is by specifying '-h 127.0.0.1', 
>which results in a pointless

>Nov 18 15:45:05 HOST rpcbind: cannot bind 127.0.0.1 on udp: Address 
>already in use
>Nov 18 15:45:05 HOST rpcbind: cannot bind 127.0.0.1 on tcp: Address 
>already in use

When you specify hosts, rpcbind automatically adds 127.0.0.1 to the
list of addresses, thus the duplicate.

Here is what rpbind does:

-> bind to local transport
        nconf = getnetconfigent("local");
        init_transport(nconf);

-> bind to all visible transports configured
        while ((nconf = getnetconfig(nc_handle))) {
                if (nconf->nc_flag & NC_VISIBLE) {
                        if (ipv6_only == 1 && strcmp(nconf->nc_protofmly,
                            "inet") == 0) {
                            /* DO NOTHING */
                        } else
                                init_transport(nconf);
                }
        }
        endnetconfig(nc_handle);

The configuration is in /etc/netconfig:

udp6       tpi_clts      v     inet6    udp     -       -
tcp6       tpi_cots_ord  v     inet6    tcp     -       -
udp        tpi_clts      v     inet     udp     -       -
tcp        tpi_cots_ord  v     inet     tcp     -       -
rawip      tpi_raw       -     inet      -      -       -
local      tpi_cots_ord  -     loopback  -      -       -

where 'v' is the NC_VISIBLE flag.

Of course that's a global setting and RPC clients use is too.




Home | Main Index | Thread Index | Old Index