aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/ppp/patches/310-precompile_filter.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/services/ppp/patches/310-precompile_filter.patch')
-rw-r--r--package/network/services/ppp/patches/310-precompile_filter.patch30
1 files changed, 14 insertions, 16 deletions
diff --git a/package/network/services/ppp/patches/310-precompile_filter.patch b/package/network/services/ppp/patches/310-precompile_filter.patch
index ec61104423..ca91d153e9 100644
--- a/package/network/services/ppp/patches/310-precompile_filter.patch
+++ b/package/network/services/ppp/patches/310-precompile_filter.patch
@@ -13,7 +13,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -50,6 +50,9 @@ MPPE=y
+@@ -51,6 +51,9 @@ MPPE=y
# and that the kernel driver support PPP packet filtering.
#FILTER=y
@@ -23,8 +23,8 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
# Uncomment the next line to enable multilink PPP (enabled by default)
# Linux distributions: Please leave multilink ENABLED in your builds
# of pppd!
-@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)
- endif
+@@ -214,6 +217,14 @@ LIBS += -lpcap -L$(STAGING_DIR)/usr/l
+ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR)/usr/include
endif
+ifdef PRECOMPILED_FILTER
@@ -40,7 +40,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
HEADERS += ipv6cp.h eui64.h
--- a/pppd/options.c
+++ b/pppd/options.c
-@@ -57,6 +57,7 @@
+@@ -56,6 +56,7 @@
#ifdef PPP_FILTER
#include <pcap.h>
@@ -48,21 +48,21 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on...
-@@ -169,6 +170,13 @@ static int setlogfile __P((char **));
- static int loadplugin __P((char **));
+@@ -168,6 +169,13 @@ static int setlogfile(char **);
+ static int loadplugin(char **);
#endif
+#ifdef PPP_PRECOMPILED_FILTER
+#include "pcap_pcc.h"
-+static int setprecompiledpassfilter __P((char **));
-+static int setprecompiledactivefilter __P((char **));
++static int setprecompiledpassfilter(char **);
++static int setprecompiledactivefilter(char **);
+#undef PPP_FILTER
+#endif
+
#ifdef PPP_FILTER
- static int setpassfilter __P((char **));
- static int setactivefilter __P((char **));
-@@ -361,6 +369,14 @@ option_t general_options[] = {
+ static int setpassfilter(char **);
+ static int setactivefilter(char **);
+@@ -360,6 +368,14 @@ option_t general_options[] = {
"set filter for active pkts", OPT_PRIO },
#endif
@@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#ifdef MAXOCTETS
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
-@@ -1516,6 +1532,29 @@ callfile(argv)
+@@ -1468,6 +1484,27 @@ callfile(char **argv)
return ok;
}
@@ -87,8 +87,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ * precompiled expression
+ */
+static int
-+setprecompiledpassfilter(argv)
-+ char **argv;
++setprecompiledpassfilter(char **argv)
+{
+ return pcap_pre_compiled (*argv, &pass_filter);
+}
@@ -97,8 +96,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
+ * setactivefilter - Set the active filter for packets
+ */
+static int
-+setprecompiledactivefilter(argv)
-+ char **argv;
++setprecompiledactivefilter(char **argv)
+{
+ return pcap_pre_compiled (*argv, &active_filter);
+}