diff -u -r netacct-mysql-0.78.orig/src/capture.c netacct-mysql-0.78/src/capture.c --- netacct-mysql-0.78.orig/src/capture.c Mon Feb 21 12:56:04 2005 +++ netacct-mysql-0.78/src/capture.c Mon Jan 9 14:06:48 2006 @@ -188,10 +188,22 @@ /* ETHERNET offset - 14 */ offset = 14; } else if(buf[14] * 256 + buf[15] == ETHERTYPE_IP) { - /* PPTP offset (ppp interface) - 16 */ - offset = 16; + /* PPTP offset (ppp interface) - 16 */ + offset = 16; + } else if(buf[24] * 256 + buf[25] == ETHERTYPE_IP) { + /* tun+ interfaces on FreeBSD */ + offset = 26; } - +#if 0 + else + { + int i; + for(i = 0; i < length - 1; i++) + if(buf[i] * 256 + buf[i+1] == ETHERTYPE_IP) + syslog(LOG_DEBUG, "ETHERTYPE_IP: %d; found at offset = %d", ETHERTYPE_IP, i); + } +#endif + /* if there is ETHERNET header found in package .. process it */ if(offset != -1) { memcpy (&tmp_iphdr, &(buf[offset]), sizeof (tmp_iphdr)); diff -u -r netacct-mysql-0.78.orig/src/collect.c netacct-mysql-0.78/src/collect.c --- netacct-mysql-0.78.orig/src/collect.c Mon Feb 21 12:56:04 2005 +++ netacct-mysql-0.78/src/collect.c Mon Jan 9 13:54:57 2006 @@ -9,7 +9,7 @@ * * */ -#include +#include #include #include "netacct.h"