From: guy Date: Sun, 24 Sep 2000 07:46:05 +0000 (+0000) Subject: In "pppoe_print()", in the loop for processing tags, "tag_type" merely X-Git-Tag: tcpdump-3.5.1~157 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/82a146e7f9c452eb27375a7d17489f6a291ffec9?ds=inline In "pppoe_print()", in the loop for processing tags, "tag_type" merely has to be set to a non-zero value at the beginning of the loop; setting it to -1 causes some compilers to warn that -1 doesn't fit in an unsigned short, so set it to 0xffff instead. --- diff --git a/print-pppoe.c b/print-pppoe.c index dccba9ba..cbdf8953 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = -"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.7 2000-09-23 08:03:40 guy Exp $ (LBL)"; +"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.8 2000-09-24 07:46:05 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -152,12 +152,12 @@ pppoe_print(register const u_char *bp, u_int length) if (pppoe_code) { /* PPP session packets don't contain tags */ - u_short tag_type = -1, tag_len; + u_short tag_type = 0xffff, tag_len; const u_char *p = pppoe_payload; /* loop invariant: p points to next tag, - tag_type is previous tag or -1 for first iteration + tag_type is previous tag or 0xffff for first iteration */ while (tag_type && p+4 < pppoe_payload + length &&