* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
- * Original code by Hannes Gredler (hannes@juniper.net)
+ * Original code by Hannes Gredler (hannes@gredler.at)
*/
/* \summary: MPLS LSP PING printer */
{ 11, "No label entry at stack-depth"},
{ 12, "Protocol not associated with interface at FEC stack depth"},
{ 13, "Premature termination of ping due to label stack shrinking to a single label"},
+ { 0, NULL},
};
switch(lspping_tlv_type) {
case LSPPING_TLV_TARGET_FEC_STACK:
while (tlv_tlen != 0) {
- /* Does the subTLV go past the end of the TLV? */
+ /* Does the subTLV header go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_header)) {
- subtlv_hexdump = TRUE;
- goto subtlv_too_short;
+ ND_PRINT((ndo, "\n\t TLV is too short"));
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* did we capture enough for fully decoding the subtlv header ? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_header));
/* Does the subTLV go past the end of the TLV? */
if (tlv_tlen < lspping_subtlv_len+sizeof(struct lspping_tlv_header)) {
- subtlv_hexdump = TRUE;
- goto subtlv_too_short;
+ ND_PRINT((ndo, "\n\t TLV is too short"));
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for fully decoding the subTLV? */
break;
}
/* do we want to see an additionally subtlv hexdump ? */
- subtlv_too_short:
if (ndo->ndo_vflag > 1 || subtlv_hexdump==TRUE)
print_unknown_data(ndo, tlv_tptr+sizeof(struct lspping_tlv_header), \
"\n\t ",
/* Does the header go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough to get the address family? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_t));
/* Does the data go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv4_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for this part of the TLV? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_ipv4_t));
/* Does the data go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv4_unmb_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for this part of the TLV? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_ipv4_unmb_t));
/* Does the data go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv6_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for this part of the TLV? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_ipv6_t));
/* Does the data go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv6_unmb_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for this part of the TLV? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_ipv6_unmb_t));
/* Does the data go past the end of the TLV? */
if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_info_t)) {
ND_PRINT((ndo, "\n\t TLV is too short"));
- goto map_tlv_tooshort;
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
}
/* Did we capture enough for this part of the TLV? */
ND_TCHECK2(*tlv_tptr, sizeof(struct lspping_tlv_downstream_map_info_t));
/* FIXME print downstream labels */
- map_tlv_tooshort:
tlv_hexdump=TRUE; /* dump the TLV until code complete */
break;
case LSPPING_TLV_BFD_DISCRIMINATOR:
if (tlv_tlen < LSPPING_TLV_BFD_DISCRIMINATOR_LEN) {
ND_PRINT((ndo, "\n\t TLV is too short"));
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
} else {
ND_TCHECK2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN);
ND_PRINT((ndo, "\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr)));
if (tlv_tlen < LSPPING_TLV_VENDOR_ENTERPRISE_LEN) {
ND_PRINT((ndo, "\n\t TLV is too short"));
+ tlv_hexdump = TRUE;
+ goto tlv_tooshort;
} else {
ND_TCHECK2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN);
vendor_id = EXTRACT_32BITS(tlv_tptr);
break;
}
/* do we want to see an additionally tlv hexdump ? */
+ tlv_tooshort:
if (ndo->ndo_vflag > 1 || tlv_hexdump==TRUE)
print_unknown_data(ndo, tptr+sizeof(struct lspping_tlv_header), "\n\t ",
lspping_tlv_len);