aboutsummaryrefslogtreecommitdiffstats
path: root/net/netsed/files
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2001-03-11 03:44:15 +0800
committerwill <will@FreeBSD.org>2001-03-11 03:44:15 +0800
commit12dd28be8d6c3c0a784bdd6efe1218bf19e247dc (patch)
tree628b7bc0e4f8e5f356161917243ce2abb08c515b /net/netsed/files
parente49eec295ebfee2017a9796428a1850f592ce248 (diff)
downloadfreebsd-ports-gnome-12dd28be8d6c3c0a784bdd6efe1218bf19e247dc.tar.gz
freebsd-ports-gnome-12dd28be8d6c3c0a784bdd6efe1218bf19e247dc.tar.zst
freebsd-ports-gnome-12dd28be8d6c3c0a784bdd6efe1218bf19e247dc.zip
Add netsed 0.01, a program that alters the contents of packets in
real-time. PR: 24178 Submitted by: Roman Shterenzon <roman@xpert.com>
Diffstat (limited to 'net/netsed/files')
-rw-r--r--net/netsed/files/patch-Makefile7
-rw-r--r--net/netsed/files/patch-netsed.c29
2 files changed, 36 insertions, 0 deletions
diff --git a/net/netsed/files/patch-Makefile b/net/netsed/files/patch-Makefile
new file mode 100644
index 000000000000..86782e2d7991
--- /dev/null
+++ b/net/netsed/files/patch-Makefile
@@ -0,0 +1,7 @@
+--- Makefile.orig Tue Jan 9 12:04:29 2001
++++ Makefile Tue Jan 9 12:04:36 2001
+@@ -1,4 +1,4 @@
+-CFLAGS = -Wall -fomit-frame-pointer -O9
++CFLAGS ?= -Wall -fomit-frame-pointer -O9
+
+ all: netsed
diff --git a/net/netsed/files/patch-netsed.c b/net/netsed/files/patch-netsed.c
new file mode 100644
index 000000000000..88c7b6ba5c8d
--- /dev/null
+++ b/net/netsed/files/patch-netsed.c
@@ -0,0 +1,29 @@
+--- netsed.c.orig Tue Jan 9 11:30:40 2001
++++ netsed.c Tue Jan 9 11:43:41 2001
+@@ -134,8 +134,10 @@
+
+
+ void bind_and_listen(int tcp,int port) {
++ int on=1;
+ struct sockaddr_in laddr;
+ lsock=socket(PF_INET,tcp ? SOCK_STREAM:SOCK_DGRAM,0);
++ setsockopt(lsock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on));
+ fcntl(lsock,F_SETFL,O_NONBLOCK);
+ laddr.sin_family = PF_INET;
+ laddr.sin_port = htons (port);
+@@ -186,7 +188,6 @@
+ rd=read(s1,buf,sizeof(buf));
+ if (rd<0 && errno!=EAGAIN) return 0; // s1 not connected
+ if (rd>0) {
+- fcntl(s2,F_SETFL,O_SYNC);
+ printf("[+] Caught server -> client packet.\n");
+ rd=sed_the_buffer(rd);
+ if (write(s2,b2,rd)<=0) return 0; // not able to send
+@@ -195,7 +196,6 @@
+ rd=read(s2,buf,sizeof(buf));
+ if (rd<0 && errno!=EAGAIN) return 0; // s2 not connected
+ if (rd>0) {
+- fcntl(s1,F_SETFL,O_SYNC);
+ printf("[+] Caught client -> server packet.\n");
+ rd=sed_the_buffer(rd);
+ if (write(s1,b2,rd)<=0) return 0; // not able to send