X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e379a5690f6db797179fa5e0845ff731db2a7af7..afc13c97218a3eb0f976adacd12dae9d80d2dbd9:/print-openflow-1.3.c diff --git a/print-openflow-1.3.c b/print-openflow-1.3.c index 79de7d7b..8008c2f3 100644 --- a/print-openflow-1.3.c +++ b/print-openflow-1.3.c @@ -661,7 +661,7 @@ of13_port_print(netdissect_options *ndo, cp += 2; /* name */ ND_PRINT(", name '"); - (void)nd_print(ndo, cp, cp + OFP_MAX_PORT_NAME_LEN); + nd_printjnp(ndo, cp, OFP_MAX_PORT_NAME_LEN); ND_PRINT("'"); cp += OFP_MAX_PORT_NAME_LEN; @@ -856,21 +856,20 @@ of13_hello_elements_print(netdissect_options *ndo, while (len) { uint16_t type, bmlen; - if (len < OF_HELLO_ELEM_MINSIZE) - goto invalid; + ND_PRINT("\n\t"); + ND_ICHECKMSG_U("remaining length", len, <, OF_HELLO_ELEM_MINSIZE); /* type */ type = GET_BE_U_2(cp); OF_FWD(2); - ND_PRINT("\n\t type %s", + ND_PRINT(" type %s", tok2str(ofphet_str, "unknown (0x%04x)", type)); /* length */ bmlen = GET_BE_U_2(cp); OF_FWD(2); ND_PRINT(", length %u", bmlen); /* cp is OF_HELLO_ELEM_MINSIZE bytes in */ - if (bmlen < OF_HELLO_ELEM_MINSIZE || - bmlen > OF_HELLO_ELEM_MINSIZE + len) - goto invalid; + ND_ICHECKMSG_U("bitmap length", bmlen, <, OF_HELLO_ELEM_MINSIZE); + ND_ICHECKMSG_U("bitmap length", bmlen, >, OF_HELLO_ELEM_MINSIZE + len); switch (type) { case OFPHET_VERSIONBITMAP: /*