X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=a270902340af97c0734f41a2411a18e7cea71563;hb=74fc0589bb4ec8f9e37711067cdc58dd5447cde5;hp=4870128868f63d10ecf1abc5b1562c06ca0f9416;hpb=36e867a96fbc20777c4d3cb15e7aa4f7180f1452;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 4870128..a270902 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: options.c,v 1.94 2004/11/04 09:46:50 paulus Exp $" +#define RCSID "$Id: options.c,v 1.98 2005/07/13 12:31:36 paulus Exp $" #include #include @@ -58,14 +58,19 @@ #ifdef PPP_FILTER #include /* - * DLT_PPP_WITH_DIRECTION is in current libpcap cvs, and should be in - * libpcap-0.8.4. Until that is released, use DLT_PPP - but that means + * There have been 3 or 4 different names for this in libpcap CVS, but + * this seems to be what they have settled on... + * For older versions of libpcap, use DLT_PPP - but that means * we lose the inbound and outbound qualifiers. */ -#ifndef DLT_PPP_WITH_DIRECTION -#define DLT_PPP_WITH_DIRECTION DLT_PPP +#ifndef DLT_PPP_PPPD +#ifdef DLT_PPP_WITHDIRECTION +#define DLT_PPP_PPPD DLT_PPP_WITHDIRECTION +#else +#define DLT_PPP_PPPD DLT_PPP #endif #endif +#endif /* PPP_FILTER */ #include "pppd.h" #include "pathnames.h" @@ -199,7 +204,8 @@ option_t general_options[] = { OPT_PRIOSUB | OPT_A2CLR | 1, &nodetach }, { "holdoff", o_int, &holdoff, - "Set time in seconds before retrying connection", OPT_PRIO }, + "Set time in seconds before retrying connection", + OPT_PRIO, &holdoff_specified }, { "idle", o_int, &idle_time_limit, "Set time in seconds before disconnecting idle link", OPT_PRIO }, @@ -272,7 +278,8 @@ option_t general_options[] = { "Stop after parsing, printing, and checking options", 1 }, { "child-timeout", o_int, &child_wait, - "Number of seconds to wait for child processes at exit" }, + "Number of seconds to wait for child processes at exit", + OPT_PRIO }, #ifdef HAVE_MULTILINK { "multilink", o_bool, &multilink, @@ -294,10 +301,10 @@ option_t general_options[] = { #endif #ifdef PPP_FILTER - { "pass-filter", 1, setpassfilter, + { "pass-filter", o_special, setpassfilter, "set filter for packets to pass", OPT_PRIO }, - { "active-filter", 1, setactivefilter, + { "active-filter", o_special, setactivefilter, "set filter for active pkts", OPT_PRIO }, #endif @@ -1445,13 +1452,13 @@ setpassfilter(argv) char **argv; { pcap_t *pc; - int ret = 0; + int ret = 1; - pc = pcap_open_dead(DLT_PPP_WITH_DIRECTION, 65535); + pc = pcap_open_dead(DLT_PPP_PPPD, 65535); if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == -1) { option_error("error in pass-filter expression: %s\n", pcap_geterr(pc)); - ret = 1; + ret = 0; } pcap_close(pc); @@ -1466,13 +1473,13 @@ setactivefilter(argv) char **argv; { pcap_t *pc; - int ret = 0; + int ret = 1; - pc = pcap_open_dead(DLT_PPP_WITH_DIRECTION, 65535); + pc = pcap_open_dead(DLT_PPP_PPPD, 65535); if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == -1) { option_error("error in active-filter expression: %s\n", pcap_geterr(pc)); - ret = 1; + ret = 0; } pcap_close(pc);