]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ldp.c
Moved the declaration of d_usec and d_sec at the beginning of the function.
[tcpdump] / print-ldp.c
index f7437440d765278bb16c6007354d9c6d34685223..c8bec13564be8bd88bce5d2011ef71c7ec1bb86f 100644 (file)
@@ -16,7 +16,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ldp.c,v 1.13 2005-05-03 08:21:09 hannes Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ldp.c,v 1.15 2005-07-11 20:15:32 hannes Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -302,7 +302,7 @@ ldp_tlv_print(register const u_char *tptr) {
            printf("IPv4, addresses:");
            for (i=0; i<(tlv_tlen-2)/4; i++) {
                printf(" %s",ipaddr_string(tptr));
-               tptr+=4;
+               tptr+=sizeof(struct in_addr);
            }
        }
 #ifdef INET6
@@ -310,7 +310,7 @@ ldp_tlv_print(register const u_char *tptr) {
            printf("IPv6, addresses:");
            for (i=0; i<(tlv_tlen-2)/16; i++) {
                printf(" %s",ip6addr_string(tptr));
-               tptr+=16;
+               tptr+=sizeof(struct in6_addr);
            }
        }
 #endif
@@ -375,6 +375,8 @@ ldp_tlv_print(register const u_char *tptr) {
                 vc_info_tlv_len = *(tptr+1);
                 if (vc_info_tlv_len < 2)
                     break;
+                if (vc_info_len < vc_info_tlv_len)
+                    break;
 
                 printf("\n\t\tInterface Parameter: %s (0x%02x), len %u",
                        tok2str(ldp_fec_martini_ifparm_values,"Unknown",vc_info_tlv_type),