From owner-freebsd-net@freebsd.org Fri Sep 27 04:47:41 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06612F5D90 for ; Fri, 27 Sep 2019 04:47:41 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail.allbsd.org (mx.allbsd.org [IPv6:2001:2f0:104:e001::41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.allbsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46ffRY6ZXVz4Lw8; Fri, 27 Sep 2019 04:47:37 +0000 (UTC) (envelope-from hrs@allbsd.org) Received: from mail-d.allbsd.org ([IPv6:2409:11:a740:4700:58:65ff:fe00:b0b]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id x8R4l5Pu055618 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) (Client CN "/CN=mail-d.allbsd.org", Issuer "/C=US/O=Let's+20Encrypt/CN=Let's+20Encrypt+20Authority+20X3"); Fri, 27 Sep 2019 13:47:16 +0900 (JST) (envelope-from hrs@allbsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=allbsd.org; s=20190220; t=1569559646; bh=qks2gIue3+0p91ILbGhGONIVb4yJ0dH6FiPt1LlyRH4=; h=Date:To:Cc:From:In-Reply-To:References; b=jZB1Xj1G/sX8cujD5mBYCl5PRfTjM/T+tsr+kxdOYkDiVZ1dklASbm83VzwkSVfey lmSt0zyySiAPblSei2lzIfBA8xtAvpb8oJo1kBIZ1v00QyQNH6GljjTS42zo7sfJMP QKVcrRryaX+dapemvNrN58ng4dKBlivFglBee+KM= Received: from alph.d.allbsd.org ([IPv6:2409:11:a740:4700:16:ceff:fe34:2700]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id x8R4l0Gb079619 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 27 Sep 2019 13:47:00 +0900 (JST) (envelope-from hrs@allbsd.org) Received: from localhost (localhost [[UNIX: localhost]]) (authenticated bits=0) by alph.d.allbsd.org (8.15.2/8.15.2) with ESMTPA id x8R4kwOK079612; Fri, 27 Sep 2019 13:47:00 +0900 (JST) (envelope-from hrs@allbsd.org) Date: Fri, 27 Sep 2019 02:31:52 +0900 (JST) Message-Id: <20190927.023152.1179355129866318906.hrs@allbsd.org> To: luthramihir708@gmail.com Cc: freebsd-net@freebsd.org, hrs@freebsd.org Subject: Re: rpc.statd already ipv6 clean? From: Hiroki Sato In-Reply-To: References: <20190926.054603.242590258844901628.hrs@allbsd.org> X-Old-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-PGPkey-fingerprint: 6C0D 2353 27CF 80C7 901E FDD2 DBB0 7DC6 6F1F 737F X-Mailer: Mew version 6.8 on Emacs 26.2 Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha512; boundary="--Security_Multipart(Fri_Sep_27_02_31_52_2019_841)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.allbsd.org [IPv6:2001:2f0:104:e001:0:0:0:41]); Fri, 27 Sep 2019 13:47:26 +0900 (JST) X-Rspamd-Queue-Id: 46ffRY6ZXVz4Lw8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=allbsd.org header.s=20190220 header.b=jZB1Xj1G; dmarc=none; spf=pass (mx1.freebsd.org: domain of hrs@allbsd.org designates 2001:2f0:104:e001::41 as permitted sender) smtp.mailfrom=hrs@allbsd.org X-Spamd-Result: default: False [-4.31 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[allbsd.org:s=20190220]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[allbsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[allbsd.org:+]; MID_CONTAINS_FROM(1.00)[]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:7514, ipnet:2001:2f0::/32, country:JP]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.21)[ip: (-9.05), ipnet: 2001:2f0::/32(-4.21), asn: 7514(2.25), country: JP(-0.02)] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2019 04:47:41 -0000 ----Security_Multipart(Fri_Sep_27_02_31_52_2019_841)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mihir Luthra wrote in : 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)----