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

Justin Pettit jpettit at nicira.com
Fri Oct 16 07:45:11 UTC 2015


> On Oct 15, 2015, at 1:19 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> 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>

Good suggestion.  Thanks!

--Justin





More information about the dev mailing list