]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow-1.3.c
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / print-openflow-1.3.c
index 9e76ba1b29358fa86b7ac9b6af1d47abb9ee1416..8008c2f38ccb4d8746189957e13086abbd5d5c33 100644 (file)
@@ -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:
                        /*