The OpenFlow 1.0 specification says:
Emergency flow mod messages must have timeout values set to zero.
Otherwise, the switch must refuse the addition and respond with an
ofp_error_msg with OFPET_FLOW_MOD_FAILED type and
OFPFMFC_BAD_EMERG_TIMEOUT code.
but Open vSwitch reported OFPFMFC_TABLE_FULL in this case. This commit
fixes the problem.
Fixes detailed_contr_sw_messages.EmerFlowTimeout failure in OFTest.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
if (fm->flags & OFPFF10_EMERG) {
/* We do not support the OpenFlow 1.0 emergency flow cache, which
* is not required in OpenFlow 1.0.1 and removed from OpenFlow 1.1.
if (fm->flags & OFPFF10_EMERG) {
/* We do not support the OpenFlow 1.0 emergency flow cache, which
* is not required in OpenFlow 1.0.1 and removed from OpenFlow 1.1.
- * There is no good error code, so just state that the flow table
- * is full.
- * Moreover, OFPFF10_EMERG overlaps with OFPFF12_RESET_COUNTS,
- * so this check must be here */
- return OFPERR_OFPFMFC_TABLE_FULL;
+ *
+ * OpenFlow 1.0 specifies the error code to use when idle_timeout
+ * or hard_timeout is nonzero. Otherwise, there is no good error
+ * code, so just state that the flow table is full. */
+ return (fm->hard_timeout || fm->idle_timeout
+ ? OFPERR_OFPFMFC_BAD_EMERG_TIMEOUT
+ : OFPERR_OFPFMFC_TABLE_FULL);
}
if (protocol & OFPUTIL_P_TID) {
}
if (protocol & OFPUTIL_P_TID) {