2020-08-03 15:45:36 +00:00
|
|
|
--- pppd/demand.c.orig
|
|
|
|
+++ pppd/demand.c
|
2006-12-19 16:17:30 +00:00
|
|
|
@@ -45,6 +45,7 @@
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#ifdef PPP_FILTER
|
|
|
|
#include <pcap-bpf.h>
|
|
|
|
+#include <linux/if_ether.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "pppd.h"
|
2020-08-03 15:45:36 +00:00
|
|
|
@@ -340,6 +341,7 @@ active_packet(p, len)
|
2006-12-19 16:17:30 +00:00
|
|
|
return 0;
|
|
|
|
proto = PPP_PROTOCOL(p);
|
|
|
|
#ifdef PPP_FILTER
|
|
|
|
+ *p = 1; /* set outbound for the filter rule */
|
|
|
|
p[0] = 1; /* outbound packet indicator */
|
|
|
|
if ((pass_filter.bf_len != 0
|
|
|
|
&& bpf_filter(pass_filter.bf_insns, p, len, len) == 0)
|
2020-08-03 15:45:36 +00:00
|
|
|
@@ -349,6 +351,7 @@ active_packet(p, len)
|
2006-12-19 16:17:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
p[0] = 0xff;
|
|
|
|
+ *p = 0xff; /* restore original ppp header */
|
|
|
|
#endif
|
|
|
|
for (i = 0; (protp = protocols[i]) != NULL; ++i) {
|
|
|
|
if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) {
|
2020-08-03 15:45:36 +00:00
|
|
|
--- pppd/options.c.orig
|
|
|
|
+++ pppd/options.c
|
|
|
|
@@ -1505,6 +1505,10 @@ setpassfilter(argv)
|
2006-12-19 16:17:30 +00:00
|
|
|
int ret = 1;
|
|
|
|
|
|
|
|
pc = pcap_open_dead(DLT_PPP_PPPD, 65535);
|
|
|
|
+ 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) == -1) {
|
|
|
|
option_error("error in pass-filter expression: %s\n",
|
|
|
|
pcap_geterr(pc));
|
2020-08-03 15:45:36 +00:00
|
|
|
@@ -1526,6 +1530,11 @@ setactivefilter(argv)
|
2006-12-19 16:17:30 +00:00
|
|
|
int ret = 1;
|
|
|
|
|
|
|
|
pc = pcap_open_dead(DLT_PPP_PPPD, 65535);
|
|
|
|
+ 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) == -1) {
|
|
|
|
option_error("error in active-filter expression: %s\n",
|
|
|
|
pcap_geterr(pc));
|