diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2020-10-03 15:25:38 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2020-10-03 15:39:11 +0100 |
commit | 300a1fa76aa361882532e425989a0efdebeb3fb4 (patch) | |
tree | da64c00e93e6f01d303e84481ad95366fda56106 /print-openflow-1.3.c | |
parent | 4c1c598fe5838646572c8e6adda0d3b55f9dd6a9 (diff) | |
download | tcpdump-300a1fa76aa361882532e425989a0efdebeb3fb4.tar.gz |
OpenFlow 1.3: Fixed-size messages didn't use len.
In that sequence of case blocks no function used length even if provided
with, so consistently do not provide the length.
Diffstat (limited to 'print-openflow-1.3.c')
-rw-r--r-- | print-openflow-1.3.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/print-openflow-1.3.c b/print-openflow-1.3.c index 5ea83b02..a44e987d 100644 --- a/print-openflow-1.3.c +++ b/print-openflow-1.3.c @@ -695,26 +695,26 @@ of13_port_print(netdissect_options *ndo, /* [OF13] Section 7.3.1 */ static void of13_features_reply_print(netdissect_options *ndo, - const u_char *cp, u_int len) + const u_char *cp) { /* datapath_id */ ND_PRINT("\n\t dpid 0x%016" PRIx64, GET_BE_U_8(cp)); - OF_FWD(8); + cp += 8; /* n_buffers */ ND_PRINT(", n_buffers %u", GET_BE_U_4(cp)); - OF_FWD(4); + cp += 4; /* n_tables */ ND_PRINT(", n_tables %u", GET_U_1(cp)); - OF_FWD(1); + cp += 1; /* auxiliary_id */ ND_PRINT(", auxiliary_id %u", GET_U_1(cp)); - OF_FWD(1); + cp += 1; /* pad */ - OF_FWD(2); + cp += 2; /* capabilities */ ND_PRINT("\n\t capabilities 0x%08x", GET_BE_U_4(cp)); of_bitmap_print(ndo, ofp_capabilities_bm, GET_BE_U_4(cp), OFPCAP_U); - OF_FWD(4); + cp += 4; /* reserved */ ND_TCHECK_4(cp); } @@ -722,12 +722,12 @@ of13_features_reply_print(netdissect_options *ndo, /* [OF13] Section 7.3.2 */ static void of13_switch_config_msg_print(netdissect_options *ndo, - const u_char *cp, u_int len) + const u_char *cp) { /* flags */ ND_PRINT("\n\t flags %s", tok2str(ofp_config_str, "invalid (0x%04x)", GET_BE_U_2(cp))); - OF_FWD(2); + cp += 2; /* miss_send_len */ ND_PRINT(", miss_send_len %s", tok2str(ofpcml_str, "%u", GET_BE_U_2(cp))); @@ -751,30 +751,30 @@ of13_role_msg_print(netdissect_options *ndo, /* [OF13] Section 7.3.4.3 */ static void of13_port_mod_print(netdissect_options *ndo, - const u_char *cp, u_int len) + const u_char *cp) { /* port_no */ ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", GET_BE_U_4(cp))); - OF_FWD(4); + cp += 4; /* pad */ - OF_FWD(4); + cp += 4; /* hw_addr */ ND_PRINT(", hw_addr %s", GET_ETHERADDR_STRING(cp)); - OF_FWD(MAC_ADDR_LEN); + cp += MAC_ADDR_LEN; /* pad2 */ - OF_FWD(2); + cp += 2; /* config */ ND_PRINT("\n\t config 0x%08x", GET_BE_U_4(cp)); of_bitmap_print(ndo, ofppc_bm, GET_BE_U_4(cp), OFPPC_U); - OF_FWD(4); + cp += 4; /* mask */ ND_PRINT("\n\t mask 0x%08x", GET_BE_U_4(cp)); of_bitmap_print(ndo, ofppc_bm, GET_BE_U_4(cp), OFPPC_U); - OF_FWD(4); + cp += 4; /* advertise */ ND_PRINT("\n\t advertise 0x%08x", GET_BE_U_4(cp)); of_bitmap_print(ndo, ofppf_bm, GET_BE_U_4(cp), OFPPF_U); - OF_FWD(4); + cp += 4; /* pad3 */ /* Always the last field, check bounds. */ ND_TCHECK_4(cp); @@ -915,7 +915,7 @@ of13_message_print(netdissect_options *ndo, goto invalid; if (ndo->ndo_vflag < 1) break; - of13_features_reply_print(ndo, cp, len); + of13_features_reply_print(ndo, cp); return; case OFPT_QUEUE_GET_CONFIG_REQUEST: /* [OF13] Section A.3.6 */ if (len != OF_QUEUE_GET_CONFIG_REQUEST_FIXLEN - OF_HEADER_FIXLEN) @@ -936,14 +936,14 @@ of13_message_print(netdissect_options *ndo, goto invalid; if (ndo->ndo_vflag < 1) break; - of13_switch_config_msg_print(ndo, cp, len); + of13_switch_config_msg_print(ndo, cp); return; case OFPT_PORT_MOD: /* [OF13] Section 7.3.4.3 */ if (len != OF_PORT_MOD_FIXLEN - OF_HEADER_FIXLEN) goto invalid; if (ndo->ndo_vflag < 1) break; - of13_port_mod_print(ndo, cp, len); + of13_port_mod_print(ndo, cp); return; case OFPT_ROLE_REQUEST: /* [OF13] Section 7.3.9 */ case OFPT_ROLE_REPLY: /* ibid */ |