Skip to content

Commit 92142d3

Browse files
Hannes Gredlerfxlb
authored andcommitted
LDP: Add missing fields of the Common Session Parameters TLV and a fix
Fix correct offset for the A&D bits. Add a LDP Common Session Parameters TLV test file.
1 parent ceee04f commit 92142d3

File tree

4 files changed

+333
-3
lines changed

4 files changed

+333
-3
lines changed

print-ldp.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,17 @@ ldp_tlv_print(netdissect_options *ndo,
328328
break;
329329

330330
case LDP_TLV_COMMON_SESSION:
331-
TLV_TCHECK(8);
331+
TLV_TCHECK(14);
332332
ND_PRINT("\n\t Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]",
333333
GET_BE_U_2(tptr), GET_BE_U_2(tptr + 2),
334-
(GET_BE_U_2(tptr + 6)&0x8000) ? "On Demand" : "Unsolicited",
335-
(GET_BE_U_2(tptr + 6)&0x4000) ? "Enabled" : "Disabled"
334+
(GET_BE_U_2(tptr + 4)&0x8000) ? "On Demand" : "Unsolicited",
335+
(GET_BE_U_2(tptr + 4)&0x4000) ? "Enabled" : "Disabled"
336+
);
337+
ND_PRINT("\n\t Path Vector Limit %u, Max-PDU length: %u, Receiver Label-Space-ID %s:%u",
338+
GET_U_1(tptr+5),
339+
GET_BE_U_2(tptr+6),
340+
GET_IPADDR_STRING(tptr+8),
341+
GET_BE_U_2(tptr+12)
336342
);
337343
break;
338344

tests/TESTLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ lmp lmp.pcap lmp.out -T lmp
115115

116116
# MPLS tests
117117
mpls-ldp-hello mpls-ldp-hello.pcap mpls-ldp-hello.out -v
118+
ldp-common-session ldp-common-session.pcap ldp-common-session.out -v
118119
ldp_infloop ldp-infinite-loop.pcap ldp_infloop.out
119120
lspping-fec-ldp lspping-fec-ldp.pcap lspping-fec-ldp.out
120121
lspping-fec-ldp-v lspping-fec-ldp.pcap lspping-fec-ldp-v.out -v

0 commit comments

Comments
 (0)