]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Cast "sizeof" to a "u_int"; it's not guaranteed to be "int" in size (it
authorguy <guy>
Wed, 13 Sep 2006 06:31:11 +0000 (06:31 +0000)
committerguy <guy>
Wed, 13 Sep 2006 06:31:11 +0000 (06:31 +0000)
could be "long", for example, and probably *is* "long" on LP64
platforms), so you can't print it with "%u", but, in this particular
case, it's going to fit in a 32-bit quantity.

print-ospf6.c

index 2a9b97f1e5cab85c42c0fe6e73c5f4f0b29dc9d2..11004856705bcc88a3e96144617139e57016a710 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.14 2006-09-05 15:50:26 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.15 2006-09-13 06:31:11 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -150,7 +150,7 @@ ospf6_print_lshdr(register const struct lsa6_hdr *lshp)
                ipaddr_string(&lshp->ls_router),
                EXTRACT_32BITS(&lshp->ls_seq),
                EXTRACT_16BITS(&lshp->ls_age),
-               EXTRACT_16BITS(&lshp->ls_length)-sizeof(struct lsa6_hdr));
+               EXTRACT_16BITS(&lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr));
 
        ospf6_print_ls_type(EXTRACT_16BITS(&lshp->ls_type), &lshp->ls_stateid);