summaryrefslogtreecommitdiff
path: root/net/netcat
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>1999-09-07 13:22:00 +0000
committeris <is@pkgsrc.org>1999-09-07 13:22:00 +0000
commit88e67247f7076a7b1d67c8a2b086541404768fc2 (patch)
tree5021a8484497579dc797c5ab6d56125faf930b4c /net/netcat
parentab2a4beb23da321462eec36e17ad6b08a7dd2a32 (diff)
downloadpkgsrc-88e67247f7076a7b1d67c8a2b086541404768fc2.tar.gz
Fixes to allow testing with IPv4 broadcast addresses:
- use inet_ntoa instead of inet_addr, so that an error is different from a possible return value - add "-b" option, to switch on SO_BROADCAST (to allow sending broadcasts)
Diffstat (limited to 'net/netcat')
-rw-r--r--net/netcat/files/patch-sum4
-rw-r--r--net/netcat/patches/patch-aa23
-rw-r--r--net/netcat/patches/patch-ab41
3 files changed, 68 insertions, 0 deletions
diff --git a/net/netcat/files/patch-sum b/net/netcat/files/patch-sum
new file mode 100644
index 00000000000..cdbcbb5802f
--- /dev/null
+++ b/net/netcat/files/patch-sum
@@ -0,0 +1,4 @@
+$NetBSD: patch-sum,v 1.1 1999/09/07 13:22:00 is Exp $
+
+MD5 (patch-aa) = 3df9be14c9a95116c7c770c5d295fd6b
+MD5 (patch-ab) = 6f2bf2ec7f09ecbbdf98d5dabe99e82e
diff --git a/net/netcat/patches/patch-aa b/net/netcat/patches/patch-aa
new file mode 100644
index 00000000000..9813b68ab0b
--- /dev/null
+++ b/net/netcat/patches/patch-aa
@@ -0,0 +1,23 @@
+$NetBSD: patch-aa,v 1.1 1999/09/07 13:22:00 is Exp $
+--- netcat.c.original Tue Sep 7 14:33:35 1999
++++ netcat.c Tue Sep 7 14:35:50 1999
+@@ -333,6 +333,7 @@
+ struct in_addr iaddr;
+ register HINF * poop = NULL;
+ register int x;
++ int rc;
+
+ /* I really want to strangle the twit who dreamed up all these sockaddr and
+ hostent abstractions, and then forced them all to be incompatible with
+@@ -361,9 +362,9 @@
+ bail ("gethostpoop fuxored");
+ strcpy (poop->name, unknown); /* preload it */
+ /* see wzv:workarounds.c for dg/ux return-a-struct inet_addr lossage */
+- iaddr.s_addr = inet_addr (name);
++ rc = inet_aton(name, &iaddr);
+
+- if (iaddr.s_addr == INADDR_NONE) { /* here's the great split: names... */
++ if (rc == 0) { /* here's the great split: names... */
+ if (numeric)
+ bail ("Can't parse %s as an IP address", name);
+ hostent = gethostbyname (name);
diff --git a/net/netcat/patches/patch-ab b/net/netcat/patches/patch-ab
new file mode 100644
index 00000000000..f2b625abf63
--- /dev/null
+++ b/net/netcat/patches/patch-ab
@@ -0,0 +1,41 @@
+$NetBSD: patch-ab,v 1.1 1999/09/07 13:22:00 is Exp $
+--- netcat.c.orig Tue Sep 7 14:43:01 1999
++++ netcat.c Tue Sep 7 14:51:37 1999
+@@ -151,6 +151,7 @@
+
+ /* global cmd flags: */
+ USHORT o_alla = 0;
++USHORT o_allowbroad = 0;
+ unsigned int o_interval = 0;
+ USHORT o_listen = 0;
+ USHORT o_nflag = 0;
+@@ -621,6 +622,13 @@
+ rr = setsockopt (nnetfd, SOL_SOCKET, SO_REUSEADDR, &x, sizeof (x));
+ if (rr == -1)
+ holler ("nnetfd reuseaddr failed"); /* ??? */
++#ifdef SO_BROADCAST
++ if (o_allowbroad) {
++ rr = setsockopt (nnetfd, SOL_SOCKET, SO_BROADCAST, &x, sizeof (x));
++ if (rr == -1)
++ holler ("nnetfd reuseaddr failed"); /* ??? */
++ }
++#endif
+ #ifdef SO_REUSEPORT /* doesnt exist everywhere... */
+ rr = setsockopt (nnetfd, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x));
+ if (rr == -1)
+@@ -1390,12 +1398,14 @@
+
+ /* If your shitbox doesn't have getopt, step into the nineties already. */
+ /* optarg, optind = next-argv-component [i.e. flag arg]; optopt = last-char */
+- while ((x = getopt (argc, argv, "ae:g:G:hi:lno:p:rs:tuvw:z")) != EOF) {
++ while ((x = getopt (argc, argv, "abe:g:G:hi:lno:p:rs:tuvw:z")) != EOF) {
+ /* Debug (("in go: x now %c, optarg %x optind %d", x, optarg, optind)) */
+ switch (x) {
+ case 'a':
+ bail ("all-A-records NIY");
+ o_alla++; break;
++ case 'b':
++ o_allowbroad++; break;
+ #ifdef GAPING_SECURITY_HOLE
+ case 'e': /* prog to exec */
+ pr00gie = optarg;