Date: Sat, 30 Jun 2018 11:22:41 +0300 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Rick Macklem <rmacklem@FreeBSD.org>, src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r335806 - projects/pnfs-planb-server/usr.sbin/nfsd Message-ID: <0c85d229-3b8f-3b4c-ba3c-34ec06728455@yandex.ru> In-Reply-To: <201806292207.w5TM7QX9052770@repo.freebsd.org> References: <201806292207.w5TM7QX9052770@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wOxAZ3H2Y5wTidZlugg1gFckvddm0P1z0 Content-Type: multipart/mixed; boundary="Cy0mHi3LpMMo4xu93hEg62X8ZtHJcBV4w"; protected-headers="v1" From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Rick Macklem <rmacklem@FreeBSD.org>, src-committers@freebsd.org, svn-src-projects@freebsd.org Message-ID: <0c85d229-3b8f-3b4c-ba3c-34ec06728455@yandex.ru> Subject: Re: svn commit: r335806 - projects/pnfs-planb-server/usr.sbin/nfsd References: <201806292207.w5TM7QX9052770@repo.freebsd.org> In-Reply-To: <201806292207.w5TM7QX9052770@repo.freebsd.org> --Cy0mHi3LpMMo4xu93hEg62X8ZtHJcBV4w Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 30.06.2018 01:07, Rick Macklem wrote: > Author: rmacklem > Date: Fri Jun 29 22:07:25 2018 > New Revision: 335806 > URL: https://svnweb.freebsd.org/changeset/base/335806 >=20 > Log: > Add support for IPv6 addresses to the "-p" option for the pNFS server= DS > specifications. >=20 > + char *mdspath, *mdsp, ip6[INET6_ADDRSTRLEN]; > + const char *ad; > int ecode; > + hints.ai_flags =3D AI_CANONNAME | AI_ADDRCONFIG; > + hints.ai_family =3D PF_UNSPEC; > hints.ai_socktype =3D SOCK_STREAM; > hints.ai_protocol =3D IPPROTO_TCP; > ecode =3D getaddrinfo(cp, NULL, &hints, &ai_tcp); > if (ecode !=3D 0) > err(1, "getaddrinfo pnfs: %s %s", cp, > gai_strerror(ecode)); > + memcpy(&sin6, res->ai_addr, sizeof(sin6)); > + ad =3D inet_ntop(AF_INET6, &sin6.sin6_addr, ip6, > + sizeof(ip6)); Hi, I'm unaware of applicability of IPv6 addresses with restricted scope in this area, but when you use inet_ntop() to get IPv6 address text representation, you can lost IPv6 scope zone id. getaddrinfo() can return sockaddr structure with properly filled sin6_scope_id field. It is better to use getnameinfo() with NI_NUMERICHOST flag. Also the size of ip6 buffer should be enough to keep scope specifier. --=20 WBR, Andrey V. Elsukov --Cy0mHi3LpMMo4xu93hEg62X8ZtHJcBV4w-- --wOxAZ3H2Y5wTidZlugg1gFckvddm0P1z0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAls3PdcACgkQAcXqBBDI oXocJAf9HrU/c/Ptmk/ZCsEAaSxuT8n8sk2EPyu8H2qDW1/HIQXD3zR0p54fwHBE iuiZmnjgVG2k4dNF1zkVsTOB++Zx/2jvAyld2JZdjWWKy1HqyXLvdIWmLlzUr0u+ yOWroPhW3r+pAWAHmJ72mtIVbRj6wJBa4ItOhA22WPQVR5ZUBvUklWhqgDUMfbII o5Cgoo2YfQSNVvFiXDkey5/4AZ4cexq0iKgI5HPguc2xYsMRGJBYvLx+sCd20vKK kzh/Ua0Kh4PD2s90EDk5vjY2SNqa3MsNNkiQFuq8bNUD07Eb0LGw3Qb6YH+3iN8e bkurSxIYHPLq1OgmhCRQ3GwNLMKAEA== =Z+au -----END PGP SIGNATURE----- --wOxAZ3H2Y5wTidZlugg1gFckvddm0P1z0--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0c85d229-3b8f-3b4c-ba3c-34ec06728455>