Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58275 - pppd libpcap tcpdump active-filter not supported in libpcap-version 0.7.2
Summary: pppd libpcap tcpdump active-filter not supported in libpcap-version 0.7.2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Dialup Developers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-25 05:42 UTC by Christian Roessner
Modified: 2005-01-09 05:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ppp-2.4.2-r3.ebuild (ppp-2.4.2-r3.ebuild,4.30 KB, text/plain)
2004-07-25 05:45 UTC, Christian Roessner
Details
Changed activefilter flag. Thanks (ppp-2.4.2-r3.ebuild,4.33 KB, text/plain)
2004-07-27 09:33 UTC, Christian Roessner
Details
Fix for the activefilter processing bug (fix_activefilter.patch,919 bytes, patch)
2005-01-04 03:36 UTC, Rüdiger Greeb
Details | Diff
New ebuild using patch for activefilter fix. (ppp-2.4.3-r1.ebuild,5.62 KB, text/plain)
2005-01-04 03:37 UTC, Rüdiger Greeb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Roessner 2004-07-25 05:42:42 UTC
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.
Comment 1 Christian Roessner 2004-07-25 05:45:25 UTC
Created attachment 36111 [details]
ppp-2.4.2-r3.ebuild

Disabling patch for pcap-bpf.h and changes to active-filter use flag
Comment 2 rajas 2004-07-27 05:47:26 UTC
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 )

;)
Comment 3 Christian Roessner 2004-07-27 09:33:43 UTC
Created attachment 36267 [details]
Changed activefilter flag. Thanks
Comment 4 Rüdiger Greeb 2004-07-30 13:22:14 UTC
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 ... :(
Comment 5 Eldad Zack (RETIRED) gentoo-dev 2004-08-20 08:15:44 UTC
Since you are disabling activefilter, the useflag should be "noactivefilter".

Also, can you post a diff -u against the portage ebuild?

Comment 6 Heinrich Wendel (RETIRED) gentoo-dev 2004-09-27 04:36:55 UTC
added the depend to the old pcap version and fixed the use flag
Comment 7 Heinrich Wendel (RETIRED) gentoo-dev 2004-09-27 04:37:14 UTC
added the depend to the old pcap version and fixed the use flag
Comment 8 SpanKY gentoo-dev 2004-10-04 17:31:06 UTC
this isnt the right fix

libpcap is not SLOT-ed ... you just added one of those constantly upgrading/downgrading problems for people
Comment 9 Heinrich Wendel (RETIRED) gentoo-dev 2004-10-05 02:36:45 UTC
a depend is a depend, if activefilter depends on an older version of libpcap, i can't change it
Comment 10 Alin Năstac (RETIRED) gentoo-dev 2004-11-28 12:57:39 UTC
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.
Comment 11 Rüdiger Greeb 2005-01-03 14:39:14 UTC
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.
Comment 12 Rüdiger Greeb 2005-01-04 03:36:31 UTC
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.
Comment 13 Rüdiger Greeb 2005-01-04 03:37:48 UTC
Created attachment 47566 [details]
New ebuild using patch for activefilter fix.

New ebuild using patch for activefilter fix.
Comment 14 Alin Năstac (RETIRED) gentoo-dev 2005-01-09 05:55:49 UTC
patch added for upstream bugs 1103-1106 
ty