summaryrefslogtreecommitdiff
path: root/print-ldp.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-05-26 22:15:50 -0700
committerGuy Harris <gharris@sonic.net>2020-05-26 22:15:50 -0700
commit351c0ad599a51374fedda513704e739e4257102b (patch)
tree7c98ebed222a89ec48053569d9b185c0fa2f060c /print-ldp.c
parenta225ce337dfbbd8f52043827b792d869e8a306e7 (diff)
downloadtcpdump-351c0ad599a51374fedda513704e739e4257102b.tar.gz
ldp: use a constant 2, not LDP_TLV_ADDRESS_LIST_AFNUM_LEN.
We already use GET_BE_U_2(), and use 2 in the TLV_TCHECK() call; this makes it a bit more obvious (if you read TLV_TCHECK()) that the test makes sure we can subtract from tlv_tlen without underflowing.
Diffstat (limited to 'print-ldp.c')
-rw-r--r--print-ldp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print-ldp.c b/print-ldp.c
index b05a1218..b5724450 100644
--- a/print-ldp.c
+++ b/print-ldp.c
@@ -354,8 +354,8 @@ ldp_tlv_print(netdissect_options *ndo,
case LDP_FEC_PREFIX:
TLV_TCHECK(2);
af = GET_BE_U_2(tptr);
- tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
- tlv_tlen-=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
+ tptr+=2;
+ tlv_tlen-=2;
if (af == AFNUM_INET) {
i=decode_prefix4(ndo, tptr, tlv_tlen, buf, sizeof(buf));
if (i == -2)