From: Ben Pfaff Date: Wed, 15 Jul 2009 20:25:11 +0000 (-0700) Subject: ovs-ofctl: Use 65535 instead of 0 for OFPP_CONTROLLER max_len. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=080ec396fd98fa6848295a7582c3fbfeb0a3589d;p=openvswitch ovs-ofctl: Use 65535 instead of 0 for OFPP_CONTROLLER max_len. OpenFlow 0.9 will change the interpretation of a max_len of 0 in an OFPP_CONTROLLER output action from "send entire packet" to "send 0 bytes of packet", but ovs-ofctl documents that specifying no argument or "ALL" as the argument to a CONTROLLER output action sends the whole packet, so we need to make that happen. --- diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h index f780f073..1d70aab9 100644 --- a/include/openflow/openflow.h +++ b/include/openflow/openflow.h @@ -320,8 +320,8 @@ enum ofp_action_type { /* Action structure for OFPAT_OUTPUT, which sends packets out 'port'. * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max - * number of bytes to send. A 'max_len' of zero means the entire packet - * should be sent. */ + * number of bytes to send. A 'max_len' of zero means no bytes of the + * packet should be sent. */ struct ofp_action_output { uint16_t type; /* OFPAT_OUTPUT. */ uint16_t len; /* Length is 8. */ diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index a39e99fc..44f214aa 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -617,6 +617,8 @@ str_to_action(char *str, struct ofpbuf *b) * packet to the controller. */ if (arg && (strspn(act, "0123456789") == strlen(act))) { oao->max_len = htons(str_to_u32(arg)); + } else { + oao->max_len = htons(UINT16_MAX); } } else if (parse_port_name(act, &port)) { put_output_action(b, port);