tcpflow - enable loopback [aparajita]

This commit is contained in:
Adam Vandenberg 2010-08-09 09:18:44 -07:00
parent 10c18ca718
commit 16c11bf673

View file

@ -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;
}