[ovs-dev] [PATCH] jsonrpc: Don't assert for 0 remotes in jsonrpc_session_open_multiple().

Numan Siddique numans at ovn.org
Mon Jun 29 07:10:01 UTC 2020


On Sat, Jun 27, 2020 at 1:17 AM Ben Pfaff <blp at ovn.org> wrote:

> It's pretty easy to get 0 remotes here from ovn-northd if you specify
> --ovnnb-db='' or --ovnnb-db='   ' on the command line.  The internals
> of jsonrpc_session aren't equipped to cope with that, so just add a
> dummy remote instead.
>
> Signed-off-by: Ben Pfaff <blp at ovn.org>
>

Acked-by: Numan Siddique <numans at ovn.org>

Thanks
Numan


> ---
>  lib/jsonrpc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
> index 060b6669d893..10c0c09962da 100644
> --- a/lib/jsonrpc.c
> +++ b/lib/jsonrpc.c
> @@ -825,8 +825,10 @@ jsonrpc_session_open_multiple(const struct svec
> *remotes, bool retry)
>      s = xmalloc(sizeof *s);
>
>      /* Set 'n' remotes from 'names'. */
> -    ovs_assert(remotes->n > 0);
>      svec_clone(&s->remotes, remotes);
> +    if (!s->remotes.n) {
> +        svec_add(&s->remotes, "invalid:");
> +    }
>      s->next_remote = 0;
>
>      s->reconnect = reconnect_create(time_msec());
> --
> 2.26.2
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>


More information about the dev mailing list