Date: Fri, 27 Sep 2019 02:31:52 +0900 (JST) From: Hiroki Sato <hrs@allbsd.org> To: luthramihir708@gmail.com Cc: freebsd-net@freebsd.org, hrs@freebsd.org Subject: Re: rpc.statd already ipv6 clean? Message-ID: <20190927.023152.1179355129866318906.hrs@allbsd.org> In-Reply-To: <CAEa=dYCv=b7JxW4Ajc%2BgBNaC7z_SEiUhwyPz5vxjUNdkzvVmHQ@mail.gmail.com> References: <CAEa=dYAnwxPjwZozU6K3GE7-Cjwx0rSemVd0ihrbUAUQw3jOLg@mail.gmail.com> <20190926.054603.242590258844901628.hrs@allbsd.org> <CAEa=dYCv=b7JxW4Ajc%2BgBNaC7z_SEiUhwyPz5vxjUNdkzvVmHQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart(Fri_Sep_27_02_31_52_2019_841)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mihir Luthra <luthramihir708@gmail.com> wrote in <CAEa=dYCv=b7JxW4Ajc+gBNaC7z_SEiUhwyPz5vxjUNdkzvVmHQ@mail.gmail.com>: lu> > lu> > lu> > I think you should learn TI-RPC API first. The nettype specifies a lu> > class of transport protocol, not address family. lu> > lu> > Thanks, I did some more research on TI-RPC today. lu> In `statd.c` what I see is in `create_service()`/`complete_service()`, lu> transport info is being fetched through getnetconfig(), which makes it lu> listen on all transports. I guess its clean in `statd.c` but same can also lu> be done in `procs.c`/`file.c`. Maybe trying all transports until it finds lu> one which is connectionless? Apologies if I got something wrong, new to lu> this topic. clnt_create() checks /etc/netconfig and tries all of the transport protocols with the specified class which are listed there, and then chooses the first usable one. So if IPv6 is available, "udp6" will be used because it is before "udp". statd.c handles the bind addresses on the server (service) side while file.c and procs.c handle the client calls. They are different. lu> Also, while looking at the code, I think it always assumes ipv4 is always lu> present. Like `127.0.0.1` is added to host list always. On ipv6 only lu> machine this may fail. Yes. We should fix this kind of hardcoded loopback addresses and make userland utilities transport-independent wherever possible. It can be replaced with getaddrinfo() with AF_UNSPEC for all available address families. -- Hiroki ----Security_Multipart(Fri_Sep_27_02_31_52_2019_841)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iMcEABMKAC0WIQRsDSNTJ8+Ax5Ae/dLbsH3Gbx9zfwUCXYz2CA8caHJzQGFsbGJz ZC5vcmcACgkQ27B9xm8fc398FAIHUMAg46tMGLZWhkUuzLstd+vuwQMb0w3sLtle 38G/vbZzEz1BXq4yjGxxmtyfsy4X0/gXmrWdI+M7ITu5G9E7CwYCB2dAU7VKk2es Lnhszomw80+2Se2USe718FRslw2v4g03YY+Njb8yWELlH4bhJTcBPE+xwN8mEta2 +Ax2JPBtkjwb =XfWX -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Sep_27_02_31_52_2019_841)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190927.023152.1179355129866318906.hrs>