summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Adapt to just committed libtls api changebeck2015-09-121-21/+14
|
* use SOCK_CLOEXEC instead of fnctl; ok guenther beck jsingderaadt2015-09-121-12/+16
|
* fix previous;jmc2015-09-122-31/+48
|
* spaces found during a readderaadt2015-09-111-19/+18
|
* Add TLS suppport to nc. Provides a useful little test and script tool.beck2015-09-113-45/+346
| | | | ok jsing@ bluhm@
* Netcat could hang during write(2) although poll(2) reports that thebluhm2015-09-081-15/+6
| | | | | | | | | socket is writeable. This happens because netcat tries to write more than the low water mark of the socket write buffer. With a non-blocking socket you may get a short write, otherwise it blocks. The latter could cause a total hang of the netcat process depending on the upper protocol. So make the network connection non-blocking. OK claudio@ millert@
* synchronize synopsis and usage.sobrado2015-09-031-2/+2
|
* remove unused variablechl2015-07-261-2/+2
| | | | ok tedu@
* The code in socks.c writes multiple times in a row to a socket. If thetobias2015-03-261-3/+6
| | | | | | | | | socket becomes invalid between these calls (e.g. connection closed), write will throw SIGPIPE. With this patch, SIGPIPE is ignored so we can handle write's -1 return value (errno will be EPIPE). Ultimately, it leads to program exit, too -- but with nicer error message. :) with input by and ok djm
* Fix error message in case of write failure.tobias2015-03-261-3/+3
| | | | ok djm
* Check for short writes in fdpass(). Clean up while at it.tobias2015-03-261-4/+3
| | | | ok djm
* Sync camel case of "ProxyUseFdpass" with ssh_config(5).tobias2015-03-261-3/+3
| | | | ok djm
* Support for nc -T on IPv6 addresses.jca2015-02-141-7/+16
| | | | ok sthen@
* my mistake. we already did increase buffers to 16k; increasing to 64ktedu2014-10-301-2/+2
| | | | would be the next stage of embiggening. restore 16k.
* rework the poll loop to poll in both directions so it doesn't get stucktedu2014-10-301-47/+211
| | | | | if one pipe stalls out. from a diff by Arne Becker. (buffer size left alone for now)
* POLLIN is not guaranteed to be set in revents for EOF so check formillert2014-10-261-3/+3
| | | | POLLHUP too. OK deraadt@
* Remove unnecessary include: netinet/in_systm.h is not needed by theselteo2014-10-241-2/+1
| | | | | | programs. ok deraadt@ millert@
* Make sure the correct errno is reported by warn* or err* and notguenther2014-07-201-2/+3
| | | | | | the errno of an intervening cleanup operation like close/unlink/etc. Diff from Doug Hogan (doug (at) acyclic.org)
* stick with 16k buffers for a little while to avoid bufferbloat.tedu2014-06-101-2/+2
| | | | | atomicio writing out 64k in one direction will cause traffic in the other direction to stall until it's complete. discussion with deraadt
* increase buffer size to 64k, and actually use it. ok deraadttedu2014-06-101-3/+3
| | | | from John-Mark Gurney
* Use errc/warnc to simplify code.guenther2014-05-201-2/+2
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* Unbreak nc -6 -l. Don't retrieve and thus later set the routing tablejca2014-03-121-3/+2
| | | | | unless -V is passed (intent of the previous commit), and use SOL_SOCKET instead of IPPROTO_IP to set the rtable in local_listen(). ok sthen@
* Once more, the default routing table id is inherited from the processclaudio2014-02-261-3/+2
| | | | like for any other process as well. OK by many
* one of the examples needs -N to work again;jmc2014-02-101-3/+3
| | | | | | | the paper trail appears to be: reported in feebsd pr docs/185353 by rol robert-eckardt de fix suggested by peter wemm diff submitted to tech by allan jude
* Only use setsockopt(..SO_RTABLE..) if the -V flag is given to nc/telnet,sthen2013-10-261-7/+7
| | | | | same style as traceroute6 (change to int and use -1 as a flag, so rtable 0 can still be used as an explicit parameter).
* Oups, a little bit overzealous. If we "route -T4 exec telnet foo", thenphessler2013-10-211-1/+2
| | | | make sure telnet runs in rdomain 4 as expected. Same for nc.
* Set the requested rdomain on the socket instead of only on the IPv4 part.phessler2013-10-211-11/+7
| | | | Also, switching to rdomain zero is a legit option so we should allow that.
* escape not-full-stop-dot at eol;jmc2013-08-201-2/+2
|
* add -F to usage() and help();jmc2013-08-201-2/+3
| | | | ok djm
* add -F flag to enabled fd-pass mode: establish connection and passdjm2013-08-202-6/+89
| | | | | | connected socket to stdout. This is useful in proxy mode to establish a connection for use by ssh in conjunction with its new ProxyUseFDPass option; ok markus@
* use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@schwarze2013-07-161-4/+4
|
* use FD_CLOEXEC instead of 1; from David Hillokan2013-04-291-2/+2
| | | | ok otto
* Don't shutdown nc(1)'s network socket when stdin closes. Matches *Hobbit*'ssthen2013-03-202-7/+17
| | | | | | original netcat and GNU netcat; revert to old behaviour with the new -N flag if needed. After much discussion with otto deraadt tedu and Martin Pelikan. ok deraadt@
* All accept() errors are considered fatal, until someone gives a differentderaadt2013-03-121-4/+5
| | | | reason. No code changed, just documenting it...
* remove some unnecessary sys/param.h inclusionsderaadt2012-12-041-3/+1
|
* Allow UDP server to receive datagrams from multiple socket pairs with -khaesbaert2012-07-072-7/+17
| | | | | | | flag. Prompted by a question from dsp at 2f30 dot org, diff from Lazarom Koromil with a few tweaks by me, many thanks. ok mikeb@ nicm@ haesbaert@
* Report incoming connections when -l is specified with -v.haesbaert2012-07-071-1/+35
| | | | | | From Ricky Zhou with a few tweaks by me. ok henning@ haesbaert@
* error out if accept() failsderaadt2012-04-011-1/+3
|
* remove IP_JUMBO, SO_JUMBO, and RTF_JUMBO.dlg2012-03-171-13/+4
| | | | no objection from mcbride@ krw@ markus@ deraadt@
* fix format strings for size_tespie2012-03-081-3/+3
| | | | ok okan@
* Update comments. ok deraadt@lum2012-02-091-4/+3
|
* Remove unused protocol value check. ok brynet@lum2012-02-091-4/+1
|
* Expand the CAVEAT section to more fully describe the behaviour oflum2012-02-071-6/+13
| | | | | | | | the -uz combination. This diff stems from a diff by brynet@ sent to tech@ help from jmc@ regarding wording.
* change -w to apply to the connection as well. manpage bit from jmc@fgsch2011-10-042-6/+44
| | | | nicm@ ok.
* Standarize the ToS option across nc/ping/traceroute so that they'llhaesbaert2011-09-172-28/+77
| | | | | | | accept the same values as pf.conf. It accepts decimal, hexadecimal and the dscp/tos keywords. The ping option was ripped of in SMALL. ok mcbride@ sthen@
* Convert SO_RTABLE's protocol level to the SOL_SOCKET; ok claudiomikeb2011-06-211-2/+2
|
* fix from pr 6207. a bit more of an explanation: we write the correctokan2011-02-121-4/+18
| | | | | | | | | | number of bits when connecting via a SOCKS 5 proxy over ipv6, but we also need to read the same number depending on the received address type. this issue is not noticeable with ssh's SOCKS 5 support since it always set the address type as ipv4. this fixes connections via SOCKS 5 proxies which set their address type as ipv6 when using ipv6. after review with, and ok, nicm@
* Minor tweaks to nc(1) man page and usage.jeremy2011-01-092-16/+23
| | | | OK jmc@, nicm@, tedu@
* Enable unix datagram support by treating ENOBUFS like EAGAIN.jeremy2011-01-081-2/+2
| | | | | | Separate commit requested by deraadt@. OK nicm@
* Support unix domain sockets in nc(1) with -Uu.jeremy2011-01-082-25/+83
| | | | | | | | | | | | | | | | | | | | | Previously, using -U with -u was an error that was not documented in the man page. Now it will use a unix socket in datagram mode. Bidirectional unix datagram communication requires a socket at both ends, so in client mode (without -l), a temporary socket is created so that responses from the server can be received. If -s is specified with -U and -u, it specifies the location of the temporary socket to create. This was mostly written way back in 2007. Since then, various improvements implemented based on suggestions from guenther@, tedu@, and nicm@. Man page help from nicm@ and jmc@. Unix datagram support requires a small change to atomicio.c in order to function correctly, this will be committed separately shortly. OK nicm@