Hello Guilhem,

On Thu, Nov 23, 2017 at 10:56:49AM +0100, Guilhem Moulin wrote:
> On Thu, 26 Oct 2017 at 15:47:25 +0200, Uwe Kleine-König wrote:
> > with the expectation that nc then bind(2)s passing
> > 
> >     .inet_pton(AF_INET6, "::1", &sin6_addr),
> > 
> > in the 2nd argument (instead of "::") to limit where the open port is
> > available.
> 
> `nc -l ::1 12345` does exactly that, any reason why you want another
> interface?

Ah, that's an inconsistency in the man page that made me fail to notice
that. Of course I don't care much about the interface, only that the
functionality is available.

The wrong conclusion I made was that if I do

        nc -l -p 12345

(i.e. specify 12345 as "source_port" to bind to) it must be "source"
that must be set to ::1 when I want nc to bind to [::1]:12345

Hmm, regarding the above command the man page claims:

        It is an error to use [-l] in conjunction with the -p, -s, or -z
        options.

which isn't treated as an error but does the same as

        nc -l 12345

(which in turn does something else when using netcat-traditional that
needs -p to specify the (more suitable named) "local port number").

Thanks for your reply
Uwe

Attachment: signature.asc
Description: PGP signature

Reply via email to