X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppdump%2Fpppdump.c;h=2b815fc9b50e41fcd2ec8c0d2a0ad93120a4aaf3;hb=509f04959ad891d7f981f035ed461d51bd1f74b0;hp=87c2e8f1ac69e95ca080058ad403975ea10a76ba;hpb=7b8db569642c83ba3283745034f2e2c95e459423;p=ppp.git diff --git a/pppdump/pppdump.c b/pppdump/pppdump.c index 87c2e8f..2b815fc 100644 --- a/pppdump/pppdump.c +++ b/pppdump/pppdump.c @@ -38,7 +38,7 @@ #include #include #include -#include "ppp_defs.h" + #include "ppp-comp.h" int hexmode; @@ -233,6 +233,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]) struct pkt { int cnt; @@ -320,7 +321,7 @@ dumpppp(f) ++r; ++r; if (endp - r > mru) - printf(" ERROR: length (%d) > MRU (%d)\n", + printf(" ERROR: length (%zd) > MRU (%d)\n", endp - r, mru); if (decompress && fcs == PPP_GOODFCS) { /* See if this is a CCP or compressed packet */