--- ipppd/options.c.orig 2005-08-07 15:47:50.000000000 +0200 +++ ipppd/options.c 2005-08-21 00:01:06.000000000 +0200 @@ -2633,6 +2633,10 @@ #ifdef IPPP_FILTER +#if !defined(DLT_PPP_WITHDIRECTION) && defined(DLT_PPP_WITH_DIRECTION) +#define DLT_PPP_WITHDIRECTION DLT_PPP_WITH_DIRECTION +#endif + #ifndef DLT_PPP_PPPD #define DLT_PPP_PPPD DLT_PPP #warning "please update your pcap version to support in/outbound DLT_PPP_PPPD filter" @@ -2646,9 +2650,17 @@ int argc; char **argv; { - if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &pass_filter, *argv, 1, netmask) == 0) + pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN); + if (!pc) { + option_error("error in pass-filter expression: pcap_open_dead failed\n"); + return 0; + } + if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == 0) { + pcap_close(pc); return 1; + } option_error("error in pass-filter expression.\n"); + pcap_close(pc); return 0; } @@ -2660,9 +2672,17 @@ int argc; char **argv; { - if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &active_filter, *argv, 1, netmask) == 0) + pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN); + if (!pc) { + option_error("error in active-filter expression: pcap_open_dead failed\n"); + return 0; + } + if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == 0) { + pcap_close(pc); return 1; + } option_error("error in active-filter expression.\n"); + pcap_close(pc); return 0; } #endif /* IPPP_FILTER */