X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1f9d3d622e419fcc44f1cd0f1e53f04004d98600..refs/pull/1034/head:/print-lldp.c diff --git a/print-lldp.c b/print-lldp.c index 358a31e1..a04f054e 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -701,7 +701,7 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } ND_PRINT("\n\t vlan name: "); - (void)nd_printzp(ndo, tptr + 7, sublen, NULL); + nd_printjnp(ndo, tptr + 7, sublen); break; case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY: if (tlv_len < 5) { @@ -712,7 +712,7 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } ND_PRINT("\n\t protocol identity: "); - (void)nd_printzp(ndo, tptr + 5, sublen, NULL); + nd_printjnp(ndo, tptr + 5, sublen); break; case LLDP_PRIVATE_8021_SUBTYPE_LINKAGGR: @@ -970,7 +970,7 @@ lldp_private_iana_print(netdissect_options *ndo, switch (subtype) { case LLDP_IANA_SUBTYPE_MUDURL: ND_PRINT("\n\t MUD-URL="); - (void)nd_printn(ndo, tptr+4, tlv_len-4, NULL); + nd_printjn(ndo, tptr+4, tlv_len-4); break; default: hexdump=TRUE; @@ -1082,7 +1082,7 @@ lldp_private_tia_print(netdissect_options *ndo, GET_U_1(tptr + 6)); /* Country code */ - (void)nd_printzp(ndo, tptr + 7, 2, NULL); + nd_printjnp(ndo, tptr + 7, 2); lci_len = lci_len-3; tptr = tptr + 9; @@ -1110,7 +1110,7 @@ lldp_private_tia_print(netdissect_options *ndo, return hexdump; } - (void)nd_printzp(ndo, tptr, ca_len, NULL); + nd_printjnp(ndo, tptr, ca_len); tptr += ca_len; lci_len -= ca_len; } @@ -1118,7 +1118,7 @@ lldp_private_tia_print(netdissect_options *ndo, case LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN: ND_PRINT("\n\t ECS ELIN id "); - (void)nd_printzp(ndo, tptr + 5, tlv_len - 5, NULL); + nd_printjnp(ndo, tptr + 5, tlv_len - 5); break; default: @@ -1155,7 +1155,7 @@ lldp_private_tia_print(netdissect_options *ndo, case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID: ND_PRINT("\n\t %s ", tok2str(lldp_tia_inventory_values, "unknown", subtype)); - (void)nd_printzp(ndo, tptr + 4, tlv_len - 4, NULL); + nd_printjnp(ndo, tptr + 4, tlv_len - 4); break; default: @@ -1350,19 +1350,17 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len) af = GET_U_1(tptr); switch (af) { case AFNUM_INET: - if (len < 4) + if (len < sizeof(nd_ipv4)) return NULL; - /* This cannot be assigned to ipaddr_string(), which is a macro. */ pfunc = ipaddr_string; break; case AFNUM_INET6: - if (len < 16) + if (len < sizeof(nd_ipv6)) return NULL; - /* This cannot be assigned to ip6addr_string(), which is a macro. */ pfunc = ip6addr_string; break; case AFNUM_802: - if (len < 6) + if (len < MAC_ADDR_LEN) return NULL; pfunc = etheraddr_string; break; @@ -1438,7 +1436,7 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo, } if (oid_len) { ND_PRINT("\n\t OID length %u", oid_len); - (void)nd_printzp(ndo, tptr + 1, oid_len, NULL); + nd_printjnp(ndo, tptr + 1, oid_len); } } @@ -1515,7 +1513,7 @@ lldp_print(netdissect_options *ndo, case LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE: case LLDP_CHASSIS_INTF_ALIAS_SUBTYPE: case LLDP_CHASSIS_PORT_COMP_SUBTYPE: - (void)nd_printzp(ndo, tptr + 1, tlv_len - 1, NULL); + nd_printjnp(ndo, tptr + 1, tlv_len - 1); break; case LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE: @@ -1556,7 +1554,7 @@ lldp_print(netdissect_options *ndo, case LLDP_PORT_AGENT_CIRC_ID_SUBTYPE: case LLDP_PORT_INTF_ALIAS_SUBTYPE: case LLDP_PORT_PORT_COMP_SUBTYPE: - (void)nd_printzp(ndo, tptr + 1, tlv_len - 1, NULL); + nd_printjnp(ndo, tptr + 1, tlv_len - 1); break; case LLDP_PORT_NETWORK_ADDR_SUBTYPE: @@ -1586,7 +1584,7 @@ lldp_print(netdissect_options *ndo, case LLDP_PORT_DESCR_TLV: if (ndo->ndo_vflag) { ND_PRINT(": "); - (void)nd_printzp(ndo, tptr, tlv_len, NULL); + nd_printjnp(ndo, tptr, tlv_len); } break; @@ -1596,13 +1594,13 @@ lldp_print(netdissect_options *ndo, * similar to the CDP printer. */ ND_PRINT(": "); - (void)nd_printzp(ndo, tptr, tlv_len, NULL); + nd_printjnp(ndo, tptr, tlv_len); break; case LLDP_SYSTEM_DESCR_TLV: if (ndo->ndo_vflag) { ND_PRINT("\n\t "); - (void)nd_printzp(ndo, tptr, tlv_len, NULL); + nd_printjnp(ndo, tptr, tlv_len); } break;