[ovs-dev] [PATCH 4/5] ovn-controller: Support multiple encaps simultaneously.

Ben Pfaff blp at nicira.com
Thu Oct 15 20:19:17 UTC 2015


On Thu, Oct 15, 2015 at 01:54:59AM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit <jpettit at nicira.com>

The chassis.c code only verifies the IP address for one of the
encapsulations, maybe it should do it for all of them, something like
this:

diff --git a/ovn/controller/chassis.c b/ovn/controller/chassis.c
index 894000d..84791c0 100644
--- a/ovn/controller/chassis.c
+++ b/ovn/controller/chassis.c
@@ -90,13 +90,16 @@ chassis_run(struct controller_ctx *ctx, const char *chassis_id)
     free(tokstr);
 
     if (chassis_rec) {
+        /* Compare desired tunnels against those currently in the database. */
         uint32_t cur_tunnels = 0;
+        bool same = true;
         for (int i = 0; i < chassis_rec->n_encaps; i++) {
             cur_tunnels |= get_tunnel_type(chassis_rec->encaps[i]->type);
+            same = same && strcmp(chassis_rec->encaps[i]->ip, encap_ip);
         }
+        same = same && req_tunnels == cur_tunnels;
 
-        if (req_tunnels == cur_tunnels
-            && !strcmp(chassis_rec->encaps[0]->ip, encap_ip)) {
+        if (same) {
             /* Nothing changed. */
             inited = true;
             return;

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list