Hi David,

> -----Original Message-----
> From: David Sommerseth <open...@sf.lists.topphemmelig.net>
> Sent: Tuesday, September 8, 2020 6:23 PM
> To: Vladislav Grishenko <themi...@yandex-team.ru>; openvpn-
> de...@lists.sourceforge.net
> Subject: Re: [Openvpn-devel] [PATCH] Fix --remote protocol can't be set 
> without
> port argument
> 
> On 03/09/2020 13:44, Vladislav Grishenko wrote:
> > According client-options.rst additional argumets ``port`` and
> > ``proto`` are both optional and it's allowed to have port absent and 
> > protocol
> set:
> >     --remote args
> >       Examples:
> >          remote server.example.net tcp
> >
> > But when protocol is set without preceeding port argument, it is being
> > misparsed as a port with subsequent error:
> >     RESOLVE: Cannot resolve host address: server.example.net:tcp
> >     (Servname not supported for ai_socktype)
> >
> > Since protocol names are predefined and don't match service names, fix
> > this behavior by checking second argument for valid protocol first.
> >
> Uhm ... I'm leaning towards a NAK to this patch and would rather suggest
> updating the man page to be correct.  This is a mistake from my side when
> converting the man page to .rst files.  The example should be:
> 
>        remote server.example.net 1194 tcp
> 

Hum. Initially all variants were supported, by checking numeric port and taking 
it as proto, if not numeric. Later port became string servname and optional 
logic was lost.
Man pages still has all of them since that time:
        remote server.exmaple.net
        remote server.exmaple.net 1194
        remote server.exmaple.net tcp

At first look there is no need for proto w/o port set,  why it can be important?
With support of server host & port discovery (DNS SRV RFC 2782), port info is 
not required, only host and protocol make sense. So I though about this one 
little step forward toward ~consistent syntax.
Does it makes any sense?

> The OpenVPN 2.4 and prior releases has this line:
> 
>        --remote host [port] [proto]
> 
> But this syntax was not supported by rst2man, so it was replaced with "args"
> and the examples coming below; which carried an error.
> 
> 
> --
> kind regards,
> 
> David Sommerseth
> OpenVPN Inc
> 




_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to