Mats Erik Andersson <[email protected]> writes: > onsdag den 19 januari 2011 klockan 08:24 skrev Simon Josefsson detta: >> Mats Erik Andersson <[email protected]> writes: >> >> > Now both are implemented, but '--ipv6' prints a warning message to >> > STDOUT and falls back to IPv4 if the system is not compiled with IPv6 >> > support. > > One correction: The warning goes to STDERR, since it is generated > by a call > > error(EXIT_SUCCESS, 0, "Warning: Falling back to IPv4, ..."). > >> Would an error be more appropriate? I'm thinking scripted use. OTOH, >> for logger you would probably prefer to get the log delivered than not >> to. Could it log an error message? ;) > > I do not understand acronyms like "OTOH", which influences this comment. > Is my understanding correct in observing these two features? > > a) Do you like the call "logger --ipv6 ..." to print the warning to stderr, > attempt the requested logging message via IPv4, and also exit execution > with a non-zero exit code? Presently the exit code is zero, but the > other two parts are included in my suggestion. > > b) Do you desire the IPv6 failure to log a local message about the > inability to use that transport, thus producing two log messages: > the intended text which is possibly non-local and the additional > failure report which remains on the local workstation/server?
I haven't made up my mind, but wanted to bring this aspect up for discussion. Other InetUtils tools fails when passed a -6 and IPv6 is not working, for example: jas@latte:~$ telnet gnu.org Trying 140.186.70.148... ^C jas@latte:~$ telnet -6 gnu.org gnu.org/telnet: lookup failure: No address associated with hostname jas@latte:~$ Generally, it feels more natural for a tool to fail when it cannot do what it is asked to, rather than give a warning and do something else. Typically users won't use --ipv4 or --ipv6 but rather use a hostname, and let the getaddrinfo() do its magic of selecting ipv4 vs ipv6, right? /Simon
