summaryrefslogtreecommitdiff
path: root/print-lspping.c
diff options
context:
space:
mode:
authorhannes <hannes>2004-06-15 07:58:45 +0000
committerhannes <hannes>2004-06-15 07:58:45 +0000
commitccabac550f1fcdc45fe2e1dba636a403127df561 (patch)
treed6fc78a6a752e563039d7339887501ea8b13084e /print-lspping.c
parent77523329c37b1954e366b3b205fcb69bec63f59a (diff)
downloadtcpdump-ccabac550f1fcdc45fe2e1dba636a403127df561.tar.gz
fix a bug in the tlv processing block (forgot to add the tlv_header when doing the calculation for the next header)
Diffstat (limited to 'print-lspping.c')
-rw-r--r--print-lspping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/print-lspping.c b/print-lspping.c
index 631ae139..0751fbe7 100644
--- a/print-lspping.c
+++ b/print-lspping.c
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.5 2004-06-12 08:54:57 hannes Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.6 2004-06-15 07:58:45 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -469,7 +469,7 @@ lspping_print(register const u_char *pptr, register u_int len) {
tptr+=sizeof(const struct lspping_common_header);
tlen-=sizeof(const struct lspping_common_header);
- while(tlen>0) {
+ while(tlen>(int)sizeof(struct lspping_tlv_header)) {
/* did we capture enough for fully decoding the tlv header ? */
if (!TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
goto trunc;
@@ -677,7 +677,7 @@ lspping_print(register const u_char *pptr, register u_int len) {
lspping_tlv_len);
tptr+=lspping_tlv_len;
- tlen-=lspping_tlv_len;
+ tlen-=lspping_tlv_len+sizeof(struct lspping_tlv_header);
}
return;
trunc: