X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..1ed63b5:/print-hncp.c diff --git a/print-hncp.c b/print-hncp.c index 4df4b1c4..0593b65b 100644 --- a/print-hncp.c +++ b/print-hncp.c @@ -162,7 +162,7 @@ format_nid(netdissect_options *ndo, const u_char *data) static char buf[4][sizeof("01:01:01:01")]; static int i = 0; i = (i + 1) % 4; - nd_snprintf(buf[i], sizeof(buf[i]), "%02x:%02x:%02x:%02x", + snprintf(buf[i], sizeof(buf[i]), "%02x:%02x:%02x:%02x", GET_U_1(data), GET_U_1(data + 1), GET_U_1(data + 2), GET_U_1(data + 3)); return buf[i]; @@ -174,7 +174,7 @@ format_256(netdissect_options *ndo, const u_char *data) static char buf[4][sizeof("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")]; static int i = 0; i = (i + 1) % 4; - nd_snprintf(buf[i], sizeof(buf[i]), "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64, + snprintf(buf[i], sizeof(buf[i]), "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64, GET_BE_U_8(data), GET_BE_U_8(data + 8), GET_BE_U_8(data + 16), @@ -189,7 +189,7 @@ format_interval(const uint32_t n) static char buf[4][sizeof("0000000.000s")]; static int i = 0; i = (i + 1) % 4; - nd_snprintf(buf[i], sizeof(buf[i]), "%u.%03us", n / 1000, n % 1000); + snprintf(buf[i], sizeof(buf[i]), "%u.%03us", n / 1000, n % 1000); return buf[i]; } @@ -210,7 +210,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length) if (GET_U_1(prefix) >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && is_ipv4_mapped_address(prefix + 1)) { - struct in_addr addr; + nd_ipv4 addr; u_int plen; plen = GET_U_1(prefix) - 96; @@ -227,10 +227,12 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length) ((u_char *)&addr)[plenbytes - 1] &= ((0xff00 >> (plen % 8)) & 0xff); } - nd_snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen); + snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen); plenbytes += 1 + IPV4_MAPPED_HEADING_LEN; } else { plenbytes = decode_prefix6(ndo, prefix, max_length, buf, sizeof(buf)); + if (plenbytes < 0) + return plenbytes; } ND_PRINT("%s", buf); @@ -303,7 +305,7 @@ dhcpv4_print(netdissect_options *ndo, const u_char *tp = value; while (tp < value + optlen) { ND_PRINT(" "); - if ((tp = ns_nprint(ndo, tp, value + optlen)) == NULL) + if ((tp = fqdn_print(ndo, tp, value + optlen)) == NULL) return -1; } } @@ -356,7 +358,7 @@ dhcpv6_print(netdissect_options *ndo, const u_char *tp = value; while (tp < value + optlen) { ND_PRINT(" "); - if ((tp = ns_nprint(ndo, tp, value + optlen)) == NULL) + if ((tp = fqdn_print(ndo, tp, value + optlen)) == NULL) return -1; } }