From 498c09f69dba8d4282f6f58a0724c56fad7cd8e7 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 9 Aug 2010 09:18:44 -0700 Subject: tcpflow - enable loopback [aparajita] --- Library/Formula/tcpflow.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/tcpflow.rb b/Library/Formula/tcpflow.rb index aef9eebff..d03f12931 100644 --- a/Library/Formula/tcpflow.rb +++ b/Library/Formula/tcpflow.rb @@ -36,3 +36,25 @@ __END__ /* set the current to the maximum or specified value */ if (max_desired_fds) limit.rlim_cur = max_desired_fds; + +--- a/src/datalink.c 2002-03-29 18:19:03.000000000 -0500 ++++ b/src/datalink.c 2010-08-06 17:40:55.000000000 -0400 +@@ -49,6 +49,9 @@ + * DLT_NULL is used by the localhost interface. */ + #define NULL_HDRLEN 4 + ++/* loopback family */ ++#define AF_LOOPBACK 0x2000000 ++ + void dl_null(u_char *user, const struct pcap_pkthdr *h, const u_char *p) + { + u_int caplen = h->caplen; +@@ -72,7 +75,7 @@ + /* make sure this is AF_INET */ + memcpy((char *)&family, (char *)p, sizeof(family)); + family = ntohl(family); +- if (family != AF_INET) { ++ if (family != AF_INET && family != AF_LOOPBACK) { + DEBUG(6) ("warning: received non-AF_INET null frame (type %d)", family); + return; + } -- cgit v1.2.3