summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2014-06-05 18:54:47 +0900
committerBen Pfaff <blp@nicira.com>2014-06-05 13:17:21 -0700
commitd7ab846ec79b8e10effe6f60c4157b93399ec6a7 (patch)
treefb994733dccb670fb541c211fa9cdae02a883ae9
parentebb7431f6ea6eaffc04f9fff704b8a0f95a4f57a (diff)
downloadopenvswitch-d7ab846ec79b8e10effe6f60c4157b93399ec6a7.tar.gz
ofproto: Send monitor updates if a flow mod changes a rules actions
Without this change a monitor update will be sent when a flow mod changes a rules cookie but not if only the actions are updated. This appears to be a logic error. I noticed this while working on implementing OpenFlow1.4 flow monitor as an OpenFlow1.4 flow mod does not update a rules cookie. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--ofproto/ofproto.c4
-rw-r--r--tests/ofproto.at5
2 files changed, 7 insertions, 2 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 58f09a04c..e4f8e950a 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
* Copyright (c) 2010 Jean Tourrilhes - HP-Labs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -4027,7 +4027,7 @@ ofopgroup_complete(struct ofopgroup *group)
if (!(op->error
|| ofproto_rule_is_hidden(rule)
|| (op->type == OFOPERATION_MODIFY
- && op->ofpacts
+ && !op->ofpacts
&& rule->flow_cookie == op->flow_cookie))) {
/* Check that we can just cast from ofoperation_type to
* nx_flow_update_event. */
diff --git a/tests/ofproto.at b/tests/ofproto.at
index e1e7d4730..3283384b0 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -818,6 +818,7 @@ ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
ovs-ofctl add-flow br0 in_port=0,actions=output:23
+ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
ovs-ofctl del-flows br0 dl_vlan=123
ovs-ofctl del-flows br0
@@ -881,6 +882,10 @@ NXST_FLOW_MONITOR reply (xid=0x0):
NXST_FLOW_MONITOR reply (xid=0x0):
event=ADDED table=0 cookie=0 in_port=0 actions=output:23
NXST_FLOW_MONITOR reply (xid=0x0):
+ event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
+ event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
+ event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
+NXST_FLOW_MONITOR reply (xid=0x0):
event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3