Greetings yaolingfei,

543981924--- via dev <[email protected]> writes:

> From: yaolingfei <[email protected]>

Please add a commit message that describes exactly what problem(s) you
are trying to solve.  Describe what happens when duplicate controllers
are added without this check (is there a leak?).

Also, if I'm reading right, there should be a fixes line like:

  7d674866d2c9 (ofproto: Add support for remote "service controllers")

> Signed-off-by: yaolingfei <[email protected]>
> ---
>  vswitchd/bridge.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 475eefefa..dd7b78089 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -4015,10 +4015,10 @@ bridge_configure_remotes(struct bridge *br,
>  
>      for (size_t i = 0; i < n_controllers; i++) {
>          struct ovsrec_controller *c = controllers[i];
> +        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(2, 5);

I don't think you should change the unix socket error log rate limit
parameters.  Maybe introduce a new log limiter, or stick with the
original limit.

>          if (daemon_should_self_confine()
>              && (!strncmp(c->target, "punix:", 6)
>              || !strncmp(c->target, "unix:", 5))) {
> -            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
>              char *allowed;
>  
>              if (!strncmp(c->target, "unix:", 5)) {
> @@ -4063,6 +4063,11 @@ bridge_configure_remotes(struct bridge *br,
>              free(allowed);
>          }
>  
> +        if (shash_find(&ocs, c->target)) {
> +            VLOG_WARN_RL(&rl, "bridge %s: Duplicate controllers \"%s\"", 
> br->name, c->target);
> +            continue;
> +        }
> +
>          bridge_configure_local_iface_netdev(br, c);
>  
>          int dscp = smap_get_int(&c->other_config, "dscp", DSCP_DEFAULT);

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

Reply via email to