diff -Nru isdn4k-utils-CVS-2005-06-26.orig/ipppd/options.c isdn4k-utils-CVS-2005-06-26/ipppd/options.c --- isdn4k-utils-CVS-2005-06-26.orig/ipppd/options.c 2004-12-14 00:06:52.000000000 +0200 +++ isdn4k-utils-CVS-2005-06-26/ipppd/options.c 2005-08-14 11:10:25.239597728 +0300 @@ -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_WITHDIRECTION #define DLT_PPP_WITHDIRECTION DLT_PPP #warning "please update your pcap version to support in/outbound DLT_PPP_WITHDIRECTION filter" @@ -2646,9 +2650,18 @@ int argc; char **argv; { - if (pcap_compile_nopcap(PPP_HDRLEN, DLT_PPP_WITHDIRECTION, &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 +2673,19 @@ int argc; char **argv; { - if (pcap_compile_nopcap(PPP_HDRLEN, DLT_PPP_WITHDIRECTION, &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 */