I setup capi4k-utils, pppd-2.4.2, libpcap-0.7.2 and tcpdump-0.7.2. When using capi with AVM drivers everything works fine with latest version of libpcap (and tcpdump), but when trying to add inbound/outbound rules to /etc/ppp/options, pppd will fail. The current version of libpcap does no more support inbound/outbond. So I masked version > 0.7.2. ppp should not depend on version >0.8 and therefor the patch for switching the header to pcap-bpf.h also does not work, because version 0.7.2 does not have such a version. So some changes to the ebuild concerning libpcap, tcpdump and ppp would be necessary, if someone wants activefilter enabled. N.B.: FILTER=y in ppp is on per default, so th eUSE flag must be: use activefilter || einfo "Disabling active-filter"... Hope, someone is reading this. Thanks See attached ebuild file Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 36111 [details] ppp-2.4.2-r3.ebuild Disabling patch for pcap-bpf.h and changes to active-filter use flag
The attached ebuild could be slightly improved by depending on the activefilter-flag. The same in ebuild-words: activefilter? ( <=net-libs/libpcap-0.7.2-r1 ) ;)
Created attachment 36267 [details] Changed activefilter flag. Thanks
It is not only the inbound/outbound feature. I just setup my routing box with Gentoo and had to find out, that pppd's active-filter feature does not work with libpcap-0.8.3. The mechanism is as follows: pppd starts up, reads the active_filter parameter and passes it to libpcap calling pcap_compile(...). libpcap parses the parameter string and returns a ruleset. This ruleset is then passed from pppd to the kernel to set the active filter. Unfortunately the ruleset returned from libpcap is not correct in version 0.8.3. Either they changed the interface or they made a mistake somewhere. If you use libpcap >0.7.2 and use active-filter, I recommend that you verify the functionality. The filter just does not work, there won't appear any error messages! I have switched back to 0.7.2 and things seem to work here. Extract from my self-made kernel-debug messages: with libpcap-0.7.2: Jul 30 21:55:05 prox pppd[15023]: PAP authentication succeeded Jul 30 21:55:05 prox ppp sk_chk_filter returned 0, must be 0 Jul 30 21:55:05 prox (000) code[k]: 0028 [0x00000002], jt: 0, jf: 0 Jul 30 21:55:05 prox (001) code[k]: 0015 [0x00000021], jt: 0, jf: 3 Jul 30 21:55:05 prox (002) code[k]: 0030 [0x0000000d], jt: 0, jf: 0 Jul 30 21:55:05 prox (003) code[k]: 0015 [0x00000006], jt: 0, jf: 1 Jul 30 21:55:05 prox (004) code[k]: 0006 [0x00000004], jt: 0, jf: 0 Jul 30 21:55:05 prox (005) code[k]: 0006 [0x00000000], jt: 0, jf: 0 ... Jul 30 21:55:12 prox filter: Start processing ..... Jul 30 21:55:12 prox filter: pc = 0 Jul 30 21:55:12 prox filter: pc = 1 Jul 30 21:55:12 prox JEQ(k): A = 00000021, k = 00000021 Jul 30 21:55:12 prox filter: pc = 2 Jul 30 21:55:12 prox filter: pc = 3 Jul 30 21:55:12 prox JEQ(k): A = 00000006, k = 00000006 Jul 30 21:55:12 prox filter: pc = 4 Jul 30 21:55:12 prox ppp recv packet matched active filter (2882604) Jul 30 21:55:12 prox filter: Start processing ..... Jul 30 21:55:12 prox filter: pc = 0 Jul 30 21:55:12 prox filter: pc = 1 Jul 30 21:55:12 prox JEQ(k): A = 00000021, k = 00000021 Jul 30 21:55:12 prox filter: pc = 2 Jul 30 21:55:12 prox filter: pc = 3 Jul 30 21:55:12 prox JEQ(k): A = 00000006, k = 00000006 Jul 30 21:55:12 prox filter: pc = 4 Jul 30 21:55:12 prox ppp send packet matched active filter (2882605) with libpcap-0.8.3: Jul 30 21:40:22 prox pppd[13790]: PAP authentication succeeded Jul 30 21:40:22 prox ppp sk_chk_filter returned 0, must be 0 Jul 30 21:40:22 prox (000) code[k]: 0020 [0x00000000], jt: 0, jf: 0 Jul 30 21:40:22 prox (001) code[k]: 0015 [0x02000000], jt: 0, jf: 3 Jul 30 21:40:22 prox (002) code[k]: 0030 [0x0000000d], jt: 0, jf: 0 Jul 30 21:40:22 prox (003) code[k]: 0015 [0x00000006], jt: 0, jf: 1 Jul 30 21:40:22 prox (004) code[k]: 0006 [0x00000009], jt: 0, jf: 0 Jul 30 21:40:22 prox (005) code[k]: 0006 [0x00000000], jt: 0, jf: 0 ... Jul 30 21:40:54 prox filter: Start processing ..... Jul 30 21:40:54 prox filter: pc = 0 Jul 30 21:40:54 prox filter: pc = 1 Jul 30 21:40:54 prox JEQ(k): A = 00000021, k = 02000000 Jul 30 21:40:54 prox filter: pc = 5 Jul 30 21:40:54 prox ppp recv packet did not match active filter (2024571) Jul 30 21:40:54 prox filter: Start processing ..... Jul 30 21:40:54 prox filter: pc = 0 Jul 30 21:40:54 prox filter: pc = 1 Jul 30 21:40:54 prox JEQ(k): A = 00040021, k = 02000000 Jul 30 21:40:54 prox filter: pc = 5 Jul 30 21:40:54 prox ppp send packet did not match active filter (2024572) The active-filter was 'tcp' in both cases. A good way to look at the ruleset is to use tcpdump -d '<filter>' ... took me 3 days to find out ... :(
Since you are disabling activefilter, the useflag should be "noactivefilter". Also, can you post a diff -u against the portage ebuild?
added the depend to the old pcap version and fixed the use flag
this isnt the right fix libpcap is not SLOT-ed ... you just added one of those constantly upgrading/downgrading problems for people
a depend is a depend, if activefilter depends on an older version of libpcap, i can't change it
please try ppp-2.4.3. I understand from http://www.samba.org/ppp/README.html that it works with libpcap-0.8.3. However there is a minor setback. The mentioned libpcap version does not recognize "inbound" and "outbound" keywords, but the future 0.8.4 version will have support for this.
ppp 2.4.3 works with libpcap 0.8.3, but there is a small yet important bug in the processing of the filter options. Look at bug no. 1106 on http://samba.org/cgi-bin/ppp-bugs/ I'm pretty sure that ppp active-filter of versions <2.4.3 does NOT work together with libpcap >0.7.2. So the current (stable!) ebuilds are completely useless if you want to use the active-filter.
Created attachment 47565 [details, diff] Fix for the activefilter processing bug This patch fixes the filter processing bug in ppp-2.4.3. Place in files/2.4.3 as I assume that this bug will be fixed in the next version of ppp.
Created attachment 47566 [details] New ebuild using patch for activefilter fix. New ebuild using patch for activefilter fix.
patch added for upstream bugs 1103-1106 ty