When commit a0baa7dfa4fe ("connmgr: Make treatment of active and passive
connections more uniform") was applied, it didn't take into account
that a reconfiguration of the allowed_versions setting needs to
propagate to the rconn and pvconn (and lower connection) elements.

This change inelegantly deletes and recreates these pvconn and rconn
elements.  There's probably better ways of doing this (like maybe
adding the knob to rconn/vconn and kicking off a resync?) but I don't
know the openflow spec well enough to know whether it's possible or
supported.

A new test is added to ensure we don't break the behavior again.

Fixes: a0baa7dfa4fe ("connmgr: Make treatment of active and passive
connections more uniform")

Signed-off-by: Aaron Conole <[email protected]>
---
diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 51d656cba..37c616691 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -2021,6 +2021,26 @@ ofservice_reconfigure(struct ofservice *ofservice,
      * version. */
     if (ofservice->s.allowed_versions != settings->allowed_versions) {
         ofservice_close_all(ofservice);
+        if (ofservice->pvconn) {
+            struct pvconn *pvconn = NULL;
+            pvconn_close(ofservice->pvconn);
+            /* there is a potentially squelched error here */
+            pvconn_open(ofservice->target, settings->allowed_versions,
+                                    settings->dscp, &pvconn);
+            ofservice->pvconn = pvconn;
+        }
+
+        if (ofservice->rconn) {
+            struct rconn *rconn = NULL;
+            rconn_destroy(ofservice->rconn);
+
+            char *name = ofconn_make_name(ofservice->connmgr, 
ofservice->target);
+            rconn = rconn_create(5, 8, settings->dscp, 
settings->allowed_versions);
+            rconn_connect(rconn, ofservice->target, name);
+            free(name);
+            ofservice->rconn = rconn;
+        }
+
     }
 
     ofservice->s = *settings;
diff --git a/tests/bridge.at b/tests/bridge.at
index d48463e26..904f1381c 100644
--- a/tests/bridge.at
+++ b/tests/bridge.at
@@ -103,3 +103,20 @@ AT_CHECK([ovs-appctl -t ovs-vswitchd version], [0], 
[ignore])
 OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
 OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 AT_CLEANUP
+
+AT_SETUP([bridge - change ofproto versions])
+dnl Start vswitch and add a version test bridge
+OVS_VSWITCHD_START(
+    [add-br vr_test0 -- \
+     set bridge vr_test0 datapath-type=dummy \
+                         protocols=OpenFlow10])
+
+dnl set the version to include, say, OpenFlow14
+AT_CHECK([ovs-vsctl set bridge vr_test0 protocols=OpenFlow10,OpenFlow14])
+
+dnl now try to use bundle action on a flow
+AT_CHECK([ovs-ofctl add-flow vr_test0 --bundle actions=normal])
+
+OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+AT_CLEANUP
---
2.21.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to