- * - nc doesn't redirect stderr to the network socket for the -e PROG.
+//TODO: remove -e incompatibility?
+ * - we don't redirect stderr to the network socket for the -e PROG.
+ * (PROG can do it itself if needed, but sometimes it is NOT wanted!)
* - numeric addresses are printed in (), not [] (IPv6 looks better),
* port numbers are inside (): (1.2.3.4:5678)
* - network read errors are reported on verbose levels > 1
* (nc 1.10 treats them as EOF)
* - TCP connects from wrong ip/ports (if peer ip:port is specified
* on the command line, but accept() says that it came from different addr)
* - numeric addresses are printed in (), not [] (IPv6 looks better),
* port numbers are inside (): (1.2.3.4:5678)
* - network read errors are reported on verbose levels > 1
* (nc 1.10 treats them as EOF)
* - TCP connects from wrong ip/ports (if peer ip:port is specified
* on the command line, but accept() says that it came from different addr)
//usage:#define nc_trivial_usage
//usage: "[OPTIONS] HOST PORT - connect"
//usage: IF_NC_SERVER("\n"
//usage:#define nc_trivial_usage
//usage: "[OPTIONS] HOST PORT - connect"
//usage: IF_NC_SERVER("\n"
dup2(0, 1);
/* dup2(0, 2); - do we *really* want this? NO!
* exec'ed prog can do it yourself, if needed */
dup2(0, 1);
/* dup2(0, 2); - do we *really* want this? NO!
* exec'ed prog can do it yourself, if needed */
if (r != 0) {
/* nc 1.10 bails out instead, and its error message
* is not suppressed by o_verbose */
if (r != 0) {
/* nc 1.10 bails out instead, and its error message
* is not suppressed by o_verbose */
rr = getsockopt(netfd, IPPROTO_IP, IP_OPTIONS, optbuf, &x);
if (rr >= 0 && x) { /* we've got options, lessee em... */
rr = getsockopt(netfd, IPPROTO_IP, IP_OPTIONS, optbuf, &x);
if (rr >= 0 && x) { /* we've got options, lessee em... */
- bin2hex(bigbuf_net, optbuf, x);
- bigbuf_net[2*x] = '\0';
+ *bin2hex(bigbuf_net, optbuf, x) = '\0';
us to hang forever, and hit it */
o_wait = 5; /* enough that we'll notice?? */
rr = xsocket(ouraddr->u.sa.sa_family, SOCK_STREAM, 0);
us to hang forever, and hit it */
o_wait = 5; /* enough that we'll notice?? */
rr = xsocket(ouraddr->u.sa.sa_family, SOCK_STREAM, 0);
- IF_NC_EXTRA(, &str_i, &str_o, &o_verbose));
+ IF_NC_EXTRA(, &str_i, &str_o), &o_verbose);