]> The Tcpdump Group git mirrors - tcpdump/commitdiff
In "pppoe_print()", in the loop for processing tags, "tag_type" merely
authorguy <guy>
Sun, 24 Sep 2000 07:46:05 +0000 (07:46 +0000)
committerguy <guy>
Sun, 24 Sep 2000 07:46:05 +0000 (07:46 +0000)
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.

print-pppoe.c

index dccba9ba8efdc3ebfbe4e73a7ef9e00ee45151ff..cbdf8953e285a30a8cb48dadbfaccc2a216dcb0b 100644 (file)
@@ -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 &&