summaryrefslogtreecommitdiff
path: root/network/netcat-openbsd/patches/0009-broadcast-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'network/netcat-openbsd/patches/0009-broadcast-support.patch')
-rw-r--r--network/netcat-openbsd/patches/0009-broadcast-support.patch89
1 files changed, 0 insertions, 89 deletions
diff --git a/network/netcat-openbsd/patches/0009-broadcast-support.patch b/network/netcat-openbsd/patches/0009-broadcast-support.patch
deleted file mode 100644
index 6b2c5f1251..0000000000
--- a/network/netcat-openbsd/patches/0009-broadcast-support.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From: Aron Xu <aron@debian.org>
-Date: Mon, 13 Feb 2012 19:06:52 +0800
-Subject: broadcast support
-
----
- nc.1 | 4 +++-
- netcat.c | 22 ++++++++++++++++++++--
- 2 files changed, 23 insertions(+), 3 deletions(-)
-
---- a/nc.1
-+++ b/nc.1
-@@ -33,7 +33,7 @@
- .Nd arbitrary TCP and UDP connections and listens
- .Sh SYNOPSIS
- .Nm nc
--.Op Fl 46CDdFhklNnrStUuvZz
-+.Op Fl 46bCDdFhklNnrStUuvZz
- .Op Fl I Ar length
- .Op Fl i Ar interval
- .Op Fl M Ar ttl
-@@ -93,6 +93,8 @@ The options are as follows:
- Use IPv4 addresses only.
- .It Fl 6
- Use IPv6 addresses only.
-+.It Fl b
-+Allow broadcast.
- .It Fl C
- Send CRLF as line-ending. Each line feed (LF) character from the input
- data is translated into CR+LF before being written to the socket. Line
---- a/netcat.c
-+++ b/netcat.c
-@@ -132,6 +132,7 @@
- #define UDP_SCAN_TIMEOUT 3 /* Seconds */
-
- /* Command Line Options */
-+int bflag; /* Allow Broadcast */
- int dflag; /* detached, no stdin */
- int Fflag; /* fdpass sock to stdout */
- unsigned int iflag; /* Interval Flag */
-@@ -263,9 +264,9 @@ main(int argc, char *argv[])
-
- while ((ch = getopt(argc, argv,
- # if defined(TLS)
-- "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:q:R:rSs:T:tUuV:vW:w:X:x:Z:z"))
-+ "46bC:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:q:R:rSs:T:tUuV:vW:w:X:x:Z:z"))
- # else
-- "46CDdFhI:i:klM:m:NnO:P:p:q:rSs:T:tUuV:vW:w:X:x:Zz"))
-+ "46bCDdFhI:i:klM:m:NnO:P:p:q:rSs:T:tUuV:vW:w:X:x:Zz"))
- # endif
- != -1) {
- switch (ch) {
-@@ -275,6 +276,13 @@ main(int argc, char *argv[])
- case '6':
- family = AF_INET6;
- break;
-+ case 'b':
-+# if defined(SO_BROADCAST)
-+ bflag = 1;
-+# else
-+ errx(1, "no broadcast frame support available");
-+# endif
-+ break;
- case 'U':
- family = AF_UNIX;
- break;
-@@ -1853,6 +1861,15 @@ set_common_sockopts(int s, int af)
- {
- int x = 1;
-
-+# if defined(SO_BROADCAST)
-+ if (bflag) {
-+ /* allow datagram sockets to send packets to a broadcast address
-+ * (this option has no effect on stream-oriented sockets) */
-+ if (setsockopt(s, SOL_SOCKET, SO_BROADCAST,
-+ &x, sizeof(x)) == -1)
-+ err(1, NULL);
-+ }
-+# endif
- # if defined(TCP_MD5SIG)
- if (Sflag) {
- if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG,
-@@ -2128,6 +2145,7 @@ help(void)
- fprintf(stderr, "\tCommand Summary:\n\
- \t-4 Use IPv4\n\
- \t-6 Use IPv6\n\
-+ \t-b Allow broadcast\n\
- \t-C Send CRLF as line-ending\n\
- \t-D Enable the debug socket option\n\
- \t-d Detach from stdin\n\