X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fdemand.c;h=5e57658ea831908e98e7554e23329e51e14918a1;hb=fafbe50251efc7d6b4a8be652d085316e112b34f;hp=83b1d3729a2e661da3888918ace5383a11836434;hpb=6794beb707916559a8d3a0e0fd7ec00ca0d309aa;p=ppp.git diff --git a/pppd/demand.c b/pppd/demand.c index 83b1d37..5e57658 100644 --- a/pppd/demand.c +++ b/pppd/demand.c @@ -10,16 +10,11 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The name(s) of the authors of this software must not be used to + * 2. The name(s) of the authors of this software must not be used to * endorse or promote products derived from this software without * prior written permission. * - * 4. Redistributions of any form whatsoever must retain the following + * 3. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras * ". @@ -33,7 +28,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: demand.c,v 1.18 2004/10/28 00:15:08 paulus Exp $" +#define RCSID "$Id: demand.c,v 1.20 2005/08/25 12:14:18 paulus Exp $" #include #include @@ -346,12 +341,15 @@ active_packet(p, len) return 0; proto = PPP_PROTOCOL(p); #ifdef PPP_FILTER - if (pass_filter.bf_len != 0 - && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) - return 0; - if (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, p, len, len) == 0) + p[0] = 1; /* outbound packet indicator */ + if ((pass_filter.bf_len != 0 + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; return 0; + } + p[0] = 0xff; #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) {