From f7307b3f74f9a2fd64acc77b0c884ed1cc9afe56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Eivind=20N=C3=A6ss?= Date: Fri, 6 Aug 2021 16:52:33 -0700 Subject: [PATCH] Changing PPP_FILTER to PPP_WITH_FILTER for consistency. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Eivind Næss --- configure.ac | 6 +++--- include/net/if_ppp.h | 4 ++-- pppd/Makefile.am | 2 +- pppd/auth.c | 2 +- pppd/demand.c | 6 +++--- pppd/options.c | 12 ++++++------ pppd/pppd.h | 4 ++-- pppd/pppdconf.h.in | 4 ++-- pppd/sys-linux.c | 8 ++++---- pppd/sys-solaris.c | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 3e01cf2..af62cac 100644 --- a/configure.ac +++ b/configure.ac @@ -284,9 +284,9 @@ AX_CHECK_PCAP # # SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter -AM_CONDITIONAL([WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ]) -AM_COND_IF([WITH_FILTER], [ - AC_DEFINE([PPP_FILTER], 1, ["Have packet activity filter support"])], [ +AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ]) +AM_COND_IF([PPP_WITH_FILTER], [ + AC_DEFINE([PPP_WITH_FILTER], 1, ["Have packet activity filter support"])], [ AS_IF([test "x${build_sunos}" = "xyes"], [ AC_MSG_WARN([Packet activity filter not supported on SunOS]) with_pcap="no" diff --git a/include/net/if_ppp.h b/include/net/if_ppp.h index d08605e..1beb470 100644 --- a/include/net/if_ppp.h +++ b/include/net/if_ppp.h @@ -129,10 +129,10 @@ struct ifpppcstatsreq { #define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */ #define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */ #define PPPIOCGIDLE _IOR('t', 74, struct ppp_idle) /* get idle time */ -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #define PPPIOCSPASS _IOW('t', 71, struct bpf_program) /* set pass filter */ #define PPPIOCSACTIVE _IOW('t', 70, struct bpf_program) /* set active filt */ -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ /* PPPIOC[GS]MTU are alternatives to SIOC[GS]IFMTU, used under Ultrix */ #define PPPIOCGMTU _IOR('t', 73, int) /* get interface MTU */ diff --git a/pppd/Makefile.am b/pppd/Makefile.am index d70dd26..2cf2400 100644 --- a/pppd/Makefile.am +++ b/pppd/Makefile.am @@ -101,7 +101,7 @@ if PPP_WITH_MPPE pppd_SOURCES += mppe.c endif -if WITH_FILTER +if PPP_WITH_FILTER pppd_CPPFLAGS += $(PCAP_CFLAGS) pppd_LDFLAGS += $(PCAP_LDFLAGS) pppd_LIBS += $(PCAP_LIBS) diff --git a/pppd/auth.c b/pppd/auth.c index c6e2344..5a7863d 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -949,7 +949,7 @@ start_networks(int unit) } #endif /* PPP_WITH_MULTILINK */ -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER if (!demand) set_filters(&pass_filter, &active_filter); #endif diff --git a/pppd/demand.c b/pppd/demand.c index 0943e8a..3e32079 100644 --- a/pppd/demand.c +++ b/pppd/demand.c @@ -47,7 +47,7 @@ #include #include #include -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include #endif @@ -102,7 +102,7 @@ demand_conf(void) || ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0) fatal("Couldn't set up demand-dialled PPP interface: %m"); -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER set_filters(&pass_filter, &active_filter); #endif @@ -336,7 +336,7 @@ active_packet(unsigned char *p, int len) if (len < PPP_HDRLEN) return 0; proto = PPP_PROTOCOL(p); -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) diff --git a/pppd/options.c b/pppd/options.c index b35c059..e93c915 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -58,7 +58,7 @@ #include #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include /* * There have been 3 or 4 different names for this in libpcap CVS, but @@ -73,7 +73,7 @@ #define DLT_PPP_PPPD DLT_PPP #endif #endif -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ #include "pppd.h" #include "pathnames.h" @@ -146,7 +146,7 @@ int maxoctets_timeout = 1; /* default 1 second */ extern option_t auth_options[]; extern struct stat devstat; -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER struct bpf_program pass_filter;/* Filter program for packets to pass */ struct bpf_program active_filter; /* Filter program for link-active pkts */ #endif @@ -177,7 +177,7 @@ static int setlogfile(char **); static int loadplugin(char **); #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER static int setpassfilter(char **); static int setactivefilter(char **); #endif @@ -363,7 +363,7 @@ option_t general_options[] = { "Load a plug-in module into pppd", OPT_PRIV | OPT_A2LIST }, #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER { "pass-filter", o_special, setpassfilter, "set filter for packets to pass", OPT_PRIO }, @@ -1482,7 +1482,7 @@ callfile(char **argv) return ok; } -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER /* * setpassfilter - Set the pass filter for packets */ diff --git a/pppd/pppd.h b/pppd/pppd.h index c941b32..133ccf6 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -377,7 +377,7 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ #define PPP_OCTETS_DIRECTION_MAXSESSION 4 #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER extern struct bpf_program pass_filter; /* Filter for pkts to pass */ extern struct bpf_program active_filter; /* Filter for link-active pkts */ #endif @@ -721,7 +721,7 @@ void logwtmp(const char *, const char *, const char *); /* Write entry to wtmp file */ int get_host_seed(void); /* Get host-dependent random number seed */ int have_route_to(u_int32_t); /* Check if route to addr exists */ -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER int set_filters(struct bpf_program *pass, struct bpf_program *active); /* Set filter programs in kernel */ #endif diff --git a/pppd/pppdconf.h.in b/pppd/pppdconf.h.in index dfad5b3..a77e3eb 100644 --- a/pppd/pppdconf.h.in +++ b/pppd/pppdconf.h.in @@ -15,8 +15,8 @@ /* "Have multilink support" */ #undef PPP_WITH_MULTILINK -/* "Have packet activity filter support" */ -#undef PPP_FILTER +/* Have packet activity filter support */ +#undef PPP_WITH_FILTER /* "Have support for loadable plugins" */ #undef PPP_WITH_PLUGINS diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 94e5a19..329a141 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -157,10 +157,10 @@ #include "fsm.h" #include "ipcp.h" -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include #include -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ #ifdef LOCKLIB #include @@ -1425,7 +1425,7 @@ void ccp_flags_set (int unit, int isopen, int isup) modify_flags(ppp_dev_fd, SC_CCP_OPEN|SC_CCP_UP, x); } -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER /* * set_filters - set the active and pass filters in the kernel driver. */ @@ -1450,7 +1450,7 @@ int set_filters(struct bpf_program *pass, struct bpf_program *active) } return 1; } -#endif /* PPP_FILTER */ +#endif /* PPP_WITH_FILTER */ /******************************************************************** * diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index 8ba5ec1..080a3b6 100644 --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c @@ -131,7 +131,7 @@ #include #endif -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include #endif -- 2.39.2