ofctl_parse_target: Avoid passing invalid ofputil_protocol to ofputil_protocol_to_ofp_version
In this test, the involved ovs functions expect valid ofputil_protocol
values. Therefore, if usable_protocols is invalid, we should return.
Otherwise, ovs will abort.
Reported-at:
@@ -22,6 +22,7 @@ ofctl_parse_flows__(struct ofputil_flow_mod *fms, size_t n_fms,
if (!(usable_protocols & OFPUTIL_P_ANY)) {
printf("no usable protocol\n");
+ return;
}
for (i = 0; i < sizeof(enum ofputil_protocol) * CHAR_BIT; i++) {
protocol = 1u << i;
