[Toybox] [PATCH] netcat: make -l exit after handling a request
enh
enh at google.com
Thu Jun 29 18:59:55 PDT 2017
ping? various networking folks are looking to add tests that use
netcat, and i'd rather start them off on toybox netcat rather than BSD
and then have to move them across to toybox later. (obviously there's
other missing stuff in toybox, but these patches are the only things
they actually need right now.)
On Wed, Jun 28, 2017 at 3:47 PM, Josh Gao <jmgao at google.com> wrote:
> On Sun, Jun 25, 2017 at 12:14 PM, Rob Landley <rob at landley.net> wrote:
>>
>> 1) switching it to use xconnect() which it predates, and which is hard
>> because the various users in tree all want slighty different things out
>> of the getaddrinfo() plumbing and I've made a couple attempts to
>> unify/genericize it but keep getting pulled alway by $DAYJOB crisis du
>> jour halfway through and forgetting what design problem details I was
>> halfway through solving and have to start over again...
>
>
> BTW, I took a quick look at this because we have users that want -4/-6 (and
> IPv6 support in general). `nc -s` makes it so that you can't use xconnect
> because you don't know what to bind to until after you've resolved the
> target
> address. Something like xbind_and_connect might work, but there's also
> things
> that we might want to do in between socket and bind (e.g. setting
> SO_REUSEADDR).
>
> The thing that everyone really wants is a way to iterate over getaddrinfo
> results;
> maybe that's what should be exposed? I have a rough proof of concept patch
> attached that implements this and uses it in netcat.
>
> (There's also another edge case with -s: what happens if the host you pass
> in
> resolves to multiple addresses? OpenBSD's netcat seems to just bind the
> first
> compatible address it resolves to, so we can maybe just ignore this.)
>
> -Josh
>
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
More information about the Toybox
mailing list