X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fdemand.c;h=d610d69ac282ea83d9ca841bdea21b7c6663906a;hb=87640b7b5ceb562146a1c4b820c7e151ff078eec;hp=0943e8a381ad5ce8ee2b12b3438708357f0c63d1;hpb=2883dd07101bf851e2ea368f0c04c91aea85cff2;p=ppp.git diff --git a/pppd/demand.c b/pppd/demand.c index 0943e8a..d610d69 100644 --- a/pppd/demand.c +++ b/pppd/demand.c @@ -47,7 +47,7 @@ #include #include #include -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER #include #endif @@ -102,7 +102,7 @@ demand_conf(void) || ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0) < 0) fatal("Couldn't set up demand-dialled PPP interface: %m"); -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER set_filters(&pass_filter, &active_filter); #endif @@ -210,6 +210,7 @@ static u_short fcstab[256] = { 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; +#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff]) /* * loop_chars - process characters received from the loopback. @@ -336,7 +337,7 @@ active_packet(unsigned char *p, int len) if (len < PPP_HDRLEN) return 0; proto = PPP_PROTOCOL(p); -#ifdef PPP_FILTER +#ifdef PPP_WITH_FILTER p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 && bpf_filter(pass_filter.bf_insns, p, len, len) == 0)