summaryrefslogtreecommitdiff
path: root/net/p0f
diff options
context:
space:
mode:
authorTrevor Johnson <trevor@FreeBSD.org>2004-02-17 21:26:58 +0000
committerTrevor Johnson <trevor@FreeBSD.org>2004-02-17 21:26:58 +0000
commit1af678a0b8715cece0555ddee516b45a03417a9b (patch)
treed6fcbe143fd3d1c6e5faee36d6e44c1926fe1539 /net/p0f
parentOops, the author of the patch is really Radim Kolar. (diff)
more patches to add loopback support
PR: 62274 Submitted by: Radim Kolar
Diffstat (limited to 'net/p0f')
-rw-r--r--net/p0f/files/patch-mtu.h14
-rw-r--r--net/p0f/files/patch-p0f.c36
2 files changed, 46 insertions, 4 deletions
diff --git a/net/p0f/files/patch-mtu.h b/net/p0f/files/patch-mtu.h
new file mode 100644
index 000000000000..116c1ae95371
--- /dev/null
+++ b/net/p0f/files/patch-mtu.h
@@ -0,0 +1,14 @@
+$FreeBSD$
+Add loopback support for FreeBSD.
+author: Radim Kolar
+
+--- mtu.h.orig Fri Oct 10 20:56:39 2003
++++ mtu.h Tue Feb 17 21:10:49 2004
+@@ -58,6 +58,7 @@
+ { 4352, "FDDI" },
+ { 4500, "token ring (2)" },
+ { 9180, "FORE ATM" },
++ { 16384, "loopback" },
+ { 16436, "sometimes loopback" },
+ { 18000, "token ring x4" },
+ };
diff --git a/net/p0f/files/patch-p0f.c b/net/p0f/files/patch-p0f.c
index 680bc03ed1e4..449f830730e7 100644
--- a/net/p0f/files/patch-p0f.c
+++ b/net/p0f/files/patch-p0f.c
@@ -1,10 +1,38 @@
$FreeBSD$
-On FreeBSD, the loopback interface is normally called lo0.
+Add loopback support for FreeBSD.
author: Radim Kolar
---- p0f.c.orig Mon Oct 13 18:57:21 2003
-+++ p0f.c Tue Feb 17 20:56:15 2004
-@@ -1590,7 +1590,7 @@ int main(int argc,char** argv) {
+--- p0f.c.orig Tue Feb 17 21:11:51 2004
++++ p0f.c Tue Feb 17 21:10:48 2004
+@@ -161,7 +161,8 @@
+
+ switch(type) {
+
+- case DLT_NULL:
++ case DLT_NULL: header_len=4; break;
++
+ case DLT_SLIP:
+ case DLT_RAW: break;
+
+@@ -1199,11 +1200,15 @@
+ /* Whoops, IP header ends past end_ptr */
+ if ((_u8*)(iph + 1) > end_ptr) return;
+
+- if ( ((iph->ihl & 0x40) != 0x40) || iph->proto != IPPROTO_TCP) {
+- debug("[!] WARNING: Non-IP packet received. Bad header_len!\n");
++ if ( iph->proto != IPPROTO_TCP) {
++ debug("[!] WARNING: Non-IP packet received.\n");
+ return;
+ }
+
++ if ( ((iph->ihl & 0x40) != 0x40) ) {
++ debug("[!] WARNING: Bad header_len!\n");
++ return;
++ }
+ /* If the declared length is shorter than the snapshot (etherleak
+ or such), truncate this bad boy. */
+
+@@ -1590,7 +1595,7 @@
if (!use_iface) use_iface=pcap_lookupdev(errbuf);
#endif /* ^WIN32 */