ND_TCHECK(*mcid);
ND_PRINT((ndo, "ID: %d, Name: ", mcid->format_id));
ND_TCHECK(*mcid);
ND_PRINT((ndo, "ID: %d, Name: ", mcid->format_id));
- for(i=0; i<32; i++)
- {
- ND_PRINT((ndo, "%c", mcid->name[i]));
- if(mcid->name[i] == '\0')
- break;
- }
+ if (fn_printzp(ndo, mcid->name, 32, ndo->ndo_snapend))
+ goto trunc;
/*
* this is the common IS-REACH decoder it is called
* from various EXTD-IS REACH style TLVs (22,24,222)
/*
* this is the common IS-REACH decoder it is called
* from various EXTD-IS REACH style TLVs (22,24,222)
EXTRACT_16BITS(header_lsp->remaining_lifetime),
EXTRACT_16BITS(header_lsp->checksum)));
EXTRACT_16BITS(header_lsp->remaining_lifetime),
EXTRACT_16BITS(header_lsp->checksum)));
if (osi_print_cksum(ndo, (uint8_t *)header_lsp->lsp_id,
EXTRACT_16BITS(header_lsp->checksum),
12, length-12) == 0)
if (osi_print_cksum(ndo, (uint8_t *)header_lsp->lsp_id,
EXTRACT_16BITS(header_lsp->checksum),
12, length-12) == 0)
ND_PRINT((ndo, ", PDU length: %u, Flags: [ %s",
pdu_len,
ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : ""));
ND_PRINT((ndo, ", PDU length: %u, Flags: [ %s",
pdu_len,
ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : ""));
- for(i=1;i<tlv_len;i++) {
- if (!ND_TTEST2(*(tptr + i), 1))
- goto trunctlv;
- ND_PRINT((ndo, "%c", *(tptr + i)));
- }
+ if (fn_printzp(ndo, tptr + 1, tlv_len - 1, ndo->ndo_snapend))
+ goto trunctlv;
- while (tmp>0) {
- if (!ND_TTEST2(*tptr, 1))
- goto trunctlv;
- ND_PRINT((ndo, "%c", *tptr++));
- tmp--;
- }
+ if (fn_printzp(ndo, tptr, tmp, ndo->ndo_snapend))
+ goto trunctlv;