X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofp-util.c;h=90124ec86af0104bda224608d142f7ab22c44423;hb=44bac24ba5d22fe238bd96702707eb2029efec41;hp=48be7749fc2a076f4c5be9d64ac3fda234ca62df;hpb=5b5a3a674c975ed1ccfc38b4dae705d4fe4df0eb;p=openvswitch diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 48be7749..90124ec8 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1461,10 +1461,7 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm, } /* Converts 'fm' into an OFPT_FLOW_MOD or NXT_FLOW_MOD message according to - * 'protocol' and returns the message. - * - * 'flow_mod_table_id' should be true if the NXT_FLOW_MOD_TABLE_ID extension is - * enabled, false otherwise. */ + * 'protocol' and returns the message. */ struct ofpbuf * ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm, enum ofputil_protocol protocol) @@ -3309,6 +3306,7 @@ ofputil_check_output_port(uint16_t port, int max_ports) case OFPP_FLOOD: case OFPP_ALL: case OFPP_CONTROLLER: + case OFPP_NONE: case OFPP_LOCAL: return 0; @@ -3760,11 +3758,13 @@ ofputil_put_action(enum ofputil_action_code code, struct ofpbuf *buf) bool action_outputs_to_port(const union ofp_action *action, ovs_be16 port) { - switch (ntohs(action->type)) { - case OFPAT10_OUTPUT: + switch (ofputil_decode_action(action)) { + case OFPUTIL_OFPAT10_OUTPUT: return action->output.port == port; - case OFPAT10_ENQUEUE: + case OFPUTIL_OFPAT10_ENQUEUE: return ((const struct ofp_action_enqueue *) action)->port == port; + case OFPUTIL_NXAST_CONTROLLER: + return port == htons(OFPP_CONTROLLER); default: return false; }