pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/pppd Linux doesn't support direction-specific filt...
details: https://anonhg.NetBSD.org/pkgsrc/rev/2e164ed73433
branches: trunk
changeset: 398704:2e164ed73433
user: dsainty <dsainty%pkgsrc.org@localhost>
date: Mon Sep 07 04:08:54 2009 +0000
description:
Linux doesn't support direction-specific filters. Conform to the new
set_filters() interface introduced by Pkgsrc, but generate errors if
the outbound filters are defined.
Compile tested only (but it does at least compile!), on Linux with
/usr/include/pcap-bpf.h. No functional change on systems that previously
successfully built.
diffstat:
net/pppd/distinfo | 3 +-
net/pppd/patches/patch-bq | 59 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 1 deletions(-)
diffs (77 lines):
diff -r 44a9fdc3c5d4 -r 2e164ed73433 net/pppd/distinfo
--- a/net/pppd/distinfo Mon Sep 07 03:10:47 2009 +0000
+++ b/net/pppd/distinfo Mon Sep 07 04:08:54 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2009/08/06 15:41:54 dsainty Exp $
+$NetBSD: distinfo,v 1.10 2009/09/07 04:08:54 dsainty Exp $
SHA1 (ppp-2.4.3.tar.gz) = 5e2789f4dedc81943fa9f94c840cccc2407056f7
RMD160 (ppp-2.4.3.tar.gz) = 845821496bacb07d93bb7572a171854853ef722b
@@ -45,3 +45,4 @@
SHA1 (patch-bn) = 2527e7f82874ad3ffaa2585bb7939fbd62ee291a
SHA1 (patch-bo) = 58edaa6a2a9d542da32f2fab678a01132235a9e0
SHA1 (patch-bp) = 34b533ae19a9006f5d09fdbe299ac30e693c20d0
+SHA1 (patch-bq) = bd0db5b52214b29ac858ae96018fc2d96cd4a82b
diff -r 44a9fdc3c5d4 -r 2e164ed73433 net/pppd/patches/patch-bq
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/pppd/patches/patch-bq Mon Sep 07 04:08:54 2009 +0000
@@ -0,0 +1,59 @@
+$NetBSD: patch-bq,v 1.1 2009/09/07 04:08:54 dsainty Exp $
+
+Linux doesn't support direction-specific filters. Conform to the new
+set_filters() interface, but generate errors if the outbound filters are
+defined.
+
+--- pppd/sys-linux.c.orig 2009-09-07 15:42:24.000000000 +1200
++++ pppd/sys-linux.c 2009-09-07 15:50:01.000000000 +1200
+@@ -1293,23 +1293,38 @@
+ /*
+ * set_filters - set the active and pass filters in the kernel driver.
+ */
+-int set_filters(struct bpf_program *pass, struct bpf_program *active)
++int set_filters(struct bpf_program *pass_in, struct bpf_program *pass_out,
++ struct bpf_program *active_in, struct bpf_program *active_out)
+ {
+ struct sock_fprog fp;
+
+- fp.len = pass->bf_len;
+- fp.filter = (struct sock_filter *) pass->bf_insns;
+- if (ioctl(ppp_dev_fd, PPPIOCSPASS, &fp) < 0) {
+- if (errno == ENOTTY)
+- warn("kernel does not support PPP filtering");
+- else
+- error("Couldn't set pass-filter in kernel: %m");
++ if (pass_in->bf_len > 0) {
++ fp.len = pass_in->bf_len;
++ fp.filter = (struct sock_filter *) pass_in->bf_insns;
++ if (ioctl(ppp_dev_fd, PPPIOCSPASS, &fp) < 0) {
++ if (errno == ENOTTY)
++ warn("kernel does not support PPP filtering");
++ else
++ error("Couldn't set pass-filter in kernel: %m");
++ return 0;
++ }
++ }
++ if (pass_out->bf_len > 0) {
++ error("Linux doesn't support pass-filter-out, "
++ "use pass-filter-in for both directions.");
+ return 0;
+ }
+- fp.len = active->bf_len;
+- fp.filter = (struct sock_filter *) active->bf_insns;
+- if (ioctl(ppp_dev_fd, PPPIOCSACTIVE, &fp) < 0) {
+- error("Couldn't set active-filter in kernel: %m");
++ if (active_in->bf_len > 0) {
++ fp.len = active_in->bf_len;
++ fp.filter = (struct sock_filter *) active_in->bf_insns;
++ if (ioctl(ppp_dev_fd, PPPIOCSACTIVE, &fp) < 0) {
++ error("Couldn't set active-filter in kernel: %m");
++ return 0;
++ }
++ }
++ if (active_out->bf_len > 0) {
++ error("Linux doesn't support active-filter-out, "
++ "use active-filter-in for both directions.");
+ return 0;
+ }
+ return 1;
Home |
Main Index |
Thread Index |
Old Index