case OFPT_BARRIER_REPLY: /* ibid */
if (len)
goto invalid;
- break;
+ return;
/* OpenFlow header and fixed-size message body. */
case OFPT_SET_CONFIG: /* [OF10] Section 5.3.2 */
if (len != OF_SWITCH_CONFIG_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
/* flags */
ND_PRINT("\n\t flags %s",
tok2str(ofp_config_str, "invalid (0x%04x)",
if (len != OF_PORT_MOD_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_port_mod_print(ndo, cp);
return;
case OFPT_QUEUE_GET_CONFIG_REQUEST: /* [OF10] Section 5.3.4 */
if (len != OF_QUEUE_GET_CONFIG_REQUEST_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
/* port */
- ND_PRINT("\n\t port_no %s",
+ ND_PRINT("\n\t port %s",
tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
OF_FWD(2);
/* pad */
if (len != OF_FLOW_REMOVED_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_flow_removed_print(ndo, cp);
return;
case OFPT_PORT_STATUS: /* [OF10] Section 5.4.3 */
if (len != OF_PORT_STATUS_FIXLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
/* reason */
ND_PRINT("\n\t reason %s",
tok2str(ofppr_str, "invalid (0x%02x)", GET_U_1(cp)));
if (len < OF_FEATURES_REPLY_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_features_reply_print(ndo, cp, len);
return;
case OFPT_ECHO_REQUEST: /* [OF10] Section 5.5.2 */
case OFPT_ECHO_REPLY: /* [OF10] Section 5.5.3 */
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_data_print(ndo, cp, len);
return;
if (len < OF_ERROR_MSG_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_error_print(ndo, cp, len);
return;
case OFPT_VENDOR:
if (len < OF_VENDOR_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_vendor_message_print(ndo, cp, len);
return;
case OFPT_PACKET_IN:
if (len < OF_PACKET_IN_MINLEN - 2 - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_packet_in_print(ndo, cp, len);
return;
if (len < OF_STATS_REQUEST_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_stats_request_print(ndo, cp, len);
return;
if (len < OF_STATS_REPLY_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_stats_reply_print(ndo, cp, len);
return;
if (len < OF_PACKET_OUT_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_packet_out_print(ndo, cp, len);
return;
if (len < OF_FLOW_MOD_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
of10_flow_mod_print(ndo, cp, len);
return;
if (len < OF_QUEUE_GET_CONFIG_REPLY_MINLEN - OF_HEADER_FIXLEN)
goto invalid;
if (ndo->ndo_vflag < 1)
- goto next_message;
+ break;
/* port */
- ND_PRINT("\n\t port_no %s",
+ ND_PRINT("\n\t port %s",
tok2str(ofpp_str, "%u", GET_BE_U_2(cp)));
OF_FWD(2);
/* pad */
of10_queues_print(ndo, cp, len);
return;
} /* switch (type) */
- goto next_message;
+ /*
+ * Not a recognised type or did not print the details, fall back to
+ * a bounds check.
+ */
+ ND_TCHECK_LEN(cp, len);
+ return;
invalid: /* skip the message body */
nd_print_invalid(ndo);
-next_message:
ND_TCHECK_LEN(cp, len);
}
41 16:11:54.461743 IP (tos 0x0, ttl 64, id 60710, offset 0, flags [DF], proto TCP (6), length 120)
109.74.202.168.6653 > 88.150.169.52.4756: Flags [P.], cksum 0x3a28 (incorrect -> 0x9a6c), seq 273:341, ack 1293, win 252, options [nop,nop,TS val 590230863 ecr 50526774], length 68: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000014
- port_no 16
+ port 16
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000015
- port_no 20
+ port 20
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000016
- port_no 18
+ port 18
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000017
- port_no 22
+ port 22
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000018
- port_no 17
+ port 17
version 1.0, type BARRIER_REQUEST, length 8, xid 0x00000019
42 16:11:54.464033 IP (tos 0x0, ttl 55, id 49513, offset 0, flags [DF], proto TCP (6), length 68)
88.150.169.52.4756 > 109.74.202.168.6653: Flags [P.], cksum 0xa139 (correct), seq 1293:1309, ack 341, win 115, options [nop,nop,TS val 50526775 ecr 590230863], length 16: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 16, xid 0x00000014
- port_no 16
+ port 16
43 16:11:54.501564 IP (tos 0x0, ttl 64, id 60711, offset 0, flags [DF], proto TCP (6), length 52)
109.74.202.168.6653 > 88.150.169.52.4756: Flags [.], cksum 0x39e4 (incorrect -> 0xa1f5), seq 341, ack 1309, win 252, options [nop,nop,TS val 590230875 ecr 50526775], length 0
44 16:11:54.504038 IP (tos 0x0, ttl 55, id 49514, offset 0, flags [DF], proto TCP (6), length 124)
88.150.169.52.4756 > 109.74.202.168.6653: Flags [P.], cksum 0x9bb5 (correct), seq 1309:1381, ack 341, win 115, options [nop,nop,TS val 50526785 ecr 590230875], length 72: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 16, xid 0x00000015
- port_no 20
+ port 20
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 16, xid 0x00000016
- port_no 18
+ port 18
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 16, xid 0x00000017
- port_no 22
+ port 22
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 16, xid 0x00000018
- port_no 17
+ port 17
version 1.0, type BARRIER_REPLY, length 8, xid 0x00000019
45 16:11:54.504155 IP (tos 0x0, ttl 64, id 60712, offset 0, flags [DF], proto TCP (6), length 52)
109.74.202.168.6653 > 88.150.169.52.4756: Flags [.], cksum 0x39e4 (incorrect -> 0xa1a3), seq 341, ack 1381, win 252, options [nop,nop,TS val 590230875 ecr 50526785], length 0
21 12:21:14.029852 IP (tos 0x0, ttl 64, id 16036, offset 0, flags [DF], proto TCP (6), length 84)
172.16.1.51.6633 > 172.16.1.101.62221: Flags [P.], cksum 0x5aff (incorrect -> 0x95e2), seq 129:161, ack 1509, win 139, options [nop,nop,TS val 2256458060 ecr 1], length 32: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000008
- port_no 1
+ port 1
version 1.0, type QUEUE_GET_CONFIG_REQUEST, length 12, xid 0x00000009
- port_no 2
+ port 2
version 1.0, type BARRIER_REQUEST, length 8, xid 0x0000000a
22 12:21:14.030813 IP (tos 0xa0, ttl 64, id 10687, offset 0, flags [DF], proto TCP (6), length 196)
172.16.1.101.62221 > 172.16.1.51.6633: Flags [P.], cksum 0x8b77 (correct), seq 1509:1653, ack 161, win 2900, options [nop,nop,TS val 1 ecr 2256458060], length 144: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 144, xid 0x00000008
- port_no 1
+ port 1
queue_id 0, len 16
property NONE, len 8
queue_id 1, len 16
24 12:21:14.071040 IP (tos 0xa0, ttl 64, id 10688, offset 0, flags [DF], proto TCP (6), length 204)
172.16.1.101.62221 > 172.16.1.51.6633: Flags [P.], cksum 0x89a4 (correct), seq 1653:1805, ack 161, win 2920, options [nop,nop,TS val 1 ecr 2256458060], length 152: OpenFlow
version 1.0, type QUEUE_GET_CONFIG_REPLY, length 144, xid 0x00000009
- port_no 2
+ port 2
queue_id 0, len 16
property NONE, len 8
queue_id 1, len 16