ppp/ppp-filter.patch
Reinhard Max 4505baafb8 - New version 2.4.8.
* New pppd options have been added:
    * ifname, to set the name for the PPP interface device
    * defaultroute-metric, to set the metric for the default route
    * defaultroute6, to add an IPv6 default route (with
      nodefaultroute6 to prevent adding an IPv6 default route).
    * up_sdnotify, to have pppd notify systemd when the link is up.
  * The rp-pppoe plugin has new options:
    * host-uniq, to set the Host-Uniq value to send
    * pppoe-padi-timeout, to set the timeout for discovery packets
    * pppoe-padi-attempts, to set the number of discovery attempts.
  * Added the CLASS attribute in radius packets.
  * Fixed warnings and issues found by static analysis.
- Obsoleted patches:
  [...]
- Patches that got renamed, because they needed rediffing:
 [...] 
- bsc#1172916: Fix an outdated comment for lcp-echo-interval.

OBS-URL: https://build.opensuse.org/package/show/network/ppp?expand=0&rev=60
2020-08-03 15:45:36 +00:00

52 lines
1.5 KiB
Diff

--- pppd/demand.c.orig
+++ pppd/demand.c
@@ -45,6 +45,7 @@
#include <sys/socket.h>
#ifdef PPP_FILTER
#include <pcap-bpf.h>
+#include <linux/if_ether.h>
#endif
#include "pppd.h"
@@ -340,6 +341,7 @@ active_packet(p, len)
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)
@@ -349,6 +351,7 @@ active_packet(p, len)
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) {
--- pppd/options.c.orig
+++ pppd/options.c
@@ -1505,6 +1505,10 @@ setpassfilter(argv)
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));
@@ -1526,6 +1530,11 @@ setactivefilter(argv)
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));