X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/06181bc3ee49e68339905317c5cf5b5e17c11259..b58cddb15484ab7abbdd8d12e38a8ab768923f29:/print-ppp.c diff --git a/print-ppp.c b/print-ppp.c index 614248b0..59789853 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -31,7 +31,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.65 2001-10-24 03:49:19 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.66 2002-05-29 10:32:02 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -990,11 +990,12 @@ handle_ppp(u_int proto, const u_char *p, int length) } /* Standard PPP printer */ -void +u_int ppp_print(register const u_char *p, u_int length) { u_int proto; u_int full_length = length; + u_int hdr_len = 0; /* * Here, we assume that p points to the Address and Control @@ -1005,6 +1006,7 @@ ppp_print(register const u_char *p, u_int length) if (*p == PPP_ADDRESS && *(p + 1) == PPP_CONTROL) { p += 2; /* ACFC not used */ length -= 2; + hdr_len += 2; } if (length < 2) @@ -1013,18 +1015,21 @@ ppp_print(register const u_char *p, u_int length) proto = *p; /* PFC is used */ p++; length--; + hdr_len++; } else { proto = EXTRACT_16BITS(p); p += 2; length -= 2; + hdr_len += 2; } printf("%s %d: ", ppp_protoname(proto), full_length); handle_ppp(proto, p, length); - return; + return (hdr_len); trunc: printf("[|ppp]"); + return (0); }