On Thu, Apr 23 2020, Eric Faurot <e...@openbsd.org> wrote:
> On Thu, Apr 23, 2020 at 10:34:39AM -0600, Theo de Raadt wrote:
>> It says the keyword gets parsed, but then does performs no action.
>> 
>> But that is different from not parsing it.
>> 
>> Additionally, this explains an option which other systems support, and
>> by explaining it this way, it is also explaining our behaviour in case
>> of inet6 vs inet4 conditions.
>> 
>> So... I think it should stay.  Eric, do you have an opinion?
>
> The doc lies because the inet6 option does not set the RES_USE_INET6
> flag as stated.  I think we should leave the entry in the doc but fix
> the wording to say it's there for historical reasons and does nothing.

In the diff below I document the behavior on other operating systems
since this looks useful to Claudio.  How does it read?

(I really think this should go but if it doesn't I don't want it to stay
misleading as it is now.)

> If we want to resurrect that option at some point, maybe we can
> consider making it set the RES_USE_INET6 flag but that feels like a
> bad idea right now, and this flag is apparently deprecated.

I wholeheartedly with this, in my book RES_USE_INET6 and "options inet6"
are just early IPv6 experiments that went nowhere.
"options inet6" would break most programs that use gethostbyname(3).

> But we should also fix the manpage for res_init(3) as the description
> of the flag is wrong too.

Diff below.  Thoughts, oks?


Index: share/man/man5/resolv.conf.5
===================================================================
RCS file: /d/cvs/src/share/man/man5/resolv.conf.5,v
retrieving revision 1.59
diff -u -p -r1.59 resolv.conf.5
--- share/man/man5/resolv.conf.5        24 Jan 2020 06:16:47 -0000      1.59
+++ share/man/man5/resolv.conf.5        24 Apr 2020 08:22:25 -0000
@@ -259,12 +259,13 @@ as is often the case with
 .Xr pppoe 4
 or with tunnels.
 .It Cm inet6
-Enables support for IPv6-only applications, by setting RES_USE_INET6 in
-_res.options (see
-.Xr res_init 3 ) .
 On
 .Ox
 this option does nothing.
+On some operating systems, this option enables IPv6 support in
+.Xr gethostbyname 3
+by setting RES_USE_INET6 in _res.options (see
+.Xr res_init 3 ) .
 .It Cm insecure1
 Do not require IP source address on the reply packet to be equal to the
 server's address.
Index: lib/libc/net/res_init.3
===================================================================
RCS file: /d/cvs/src/lib/libc/net/res_init.3,v
retrieving revision 1.1
diff -u -p -r1.1 res_init.3
--- lib/libc/net/res_init.3     30 Aug 2019 18:33:17 -0000      1.1
+++ lib/libc/net/res_init.3     24 Apr 2020 08:25:46 -0000
@@ -180,12 +180,14 @@ In the past, it turned off the legacy
 .Ev HOSTALIASES
 feature.
 .It Dv RES_USE_INET6
-Enables support for IPv6-only applications.
-This causes IPv4 addresses to be returned as an IPv4 mapped address.
+With this option
+.Xr gethostbyname 3
+will return IPv6 addresses if available.
+On some operating systems this option also causes IPv4 addresses to be
+returned as IPv4-mapped IPv6 addresses.
 For example, 10.1.1.1 will be returned as ::ffff:10.1.1.1.
-On
-.Ox
-this option does nothing.
+IPv4-mapped IPv6 addresses are not supported on
+.Ox .
 .It Dv RES_USE_EDNS0
 Attach an OPT pseudo-RR for the EDNS0 extension,
 as specified in RFC 2671.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to