diff options
author | Ben Pfaff <blp@nicira.com> | 2012-05-02 14:51:51 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-05-14 14:03:17 -0700 |
commit | 2095e10be62aa96a4ad13d4f898ad232f1ecf9b6 (patch) | |
tree | 287ee1f53e84bacc02cec592cde4b951d1d1ad4a /lib | |
parent | 53bf7029adbff1361b315ed22177b1636db41f0f (diff) |
ofp-util: Match on NXAST_CONTROLLER as an output to OFPP_CONTROLLER.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ofp-util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 48be7749..f3c31de4 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -3760,11 +3760,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; } |