summaryrefslogtreecommitdiff
path: root/net-mgmt/p0f
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2014-12-14 20:43:58 +0000
committerKurt Jaeger <pi@FreeBSD.org>2014-12-14 20:43:58 +0000
commit67c5dc27aa8074a2e3424dab2643d05c7c20b1a9 (patch)
tree8e3a65310ef8c08d87f9f0ddf0f94ab903ca2376 /net-mgmt/p0f
parent- Upgrade to 0.22.1 (diff)
net-mgmt/p0f: fix p0f-sendsyn
Submitted by: Anton Yuzhaninov <citrin@citrin.ru>
Notes
Notes: svn path=/head/; revision=374722
Diffstat (limited to 'net-mgmt/p0f')
-rw-r--r--net-mgmt/p0f/Makefile1
-rw-r--r--net-mgmt/p0f/files/patch-p0f-sendsyn.c29
2 files changed, 30 insertions, 0 deletions
diff --git a/net-mgmt/p0f/Makefile b/net-mgmt/p0f/Makefile
index ef07260ca9c3..1aa60e3004bb 100644
--- a/net-mgmt/p0f/Makefile
+++ b/net-mgmt/p0f/Makefile
@@ -3,6 +3,7 @@
PORTNAME= p0f
PORTVERSION= 3.08b
+PORTREVISION= 1
CATEGORIES= net-mgmt security
MASTER_SITES= http://lcamtuf.coredump.cx/p0f3/releases/ \
http://fossies.org/unix/privat/
diff --git a/net-mgmt/p0f/files/patch-p0f-sendsyn.c b/net-mgmt/p0f/files/patch-p0f-sendsyn.c
new file mode 100644
index 000000000000..2e943de85523
--- /dev/null
+++ b/net-mgmt/p0f/files/patch-p0f-sendsyn.c
@@ -0,0 +1,29 @@
+--- tools/p0f-sendsyn.c.orig 2012-01-14 18:01:02.000000000 +0000
++++ tools/p0f-sendsyn.c 2014-12-11 14:16:03.000000000 +0000
+@@ -122,7 +122,7 @@
+ int main(int argc, char** argv) {
+
+ static struct sockaddr_in sin;
+- char one = 1;
++ int one = 1;
+ s32 sock;
+ u32 i;
+
+@@ -145,7 +145,7 @@
+
+ if (sock < 0) PFATAL("Can't open raw socket (you need to be root).");
+
+- if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, (char*)&one, sizeof(char)))
++ if (setsockopt(sock, IPPROTO_IP, IP_HDRINCL, &one, sizeof(one)))
+ PFATAL("setsockopt() on raw socket failed.");
+
+ sin.sin_family = PF_INET;
+@@ -153,7 +153,7 @@
+ memcpy(&sin.sin_addr.s_addr, ip4->dst, 4);
+
+ ip4->ver_hlen = 0x45;
+- ip4->tot_len = htons(MIN_TCP4 + 24);
++ ip4->tot_len = MIN_TCP4 + 24; /* converted to network order in kernel */
+ ip4->ttl = 192;
+ ip4->proto = PROTO_TCP;
+