Tested-by: Flavio Fernandes <[email protected] <mailto:[email protected]>>
> On Nov 3, 2020, at 11:43 AM, Lorenzo Bianconi <[email protected]> > wrote: > > Fix the following warning reported by ovn-controller when there are no > active backends for lb health_check and selection_fields have been > configured for hash computation > > flow|WARN|error parsing actions "drop; > hash_fields="ip_dst,ip_src,tcp_dst,tcp_src");": > Syntax error at `hash_fields' expecting end of input. > > Fixes: 5af304e747 ("Support selection fields in load balancer.") > Signed-off-by: Lorenzo Bianconi <[email protected]> > --- > northd/ovn-northd.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c > index 8800a3d3c..88d3e3ed2 100644 > --- a/northd/ovn-northd.c > +++ b/northd/ovn-northd.c > @@ -3598,6 +3598,8 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip > *lb_vip, > struct ds *action, > char *selection_fields) > { > + bool skip_hash_fields = false; > + > if (lb_vip->health_check) { > ds_put_cstr(action, "ct_lb(backends="); > > @@ -3616,6 +3618,7 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip > *lb_vip, > } > > if (!n_active_backends) { > + skip_hash_fields = true; > ds_clear(action); > ds_put_cstr(action, "drop;"); > } else { > @@ -3626,7 +3629,7 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip > *lb_vip, > ds_put_format(action, "ct_lb(backends=%s);", lb_vip->backend_ips); > } > > - if (selection_fields && selection_fields[0]) { > + if (!skip_hash_fields && selection_fields && selection_fields[0]) { > ds_chomp(action, ';'); > ds_chomp(action, ')'); > ds_put_format(action, "; hash_fields=\"%s\");", selection_fields); > -- > 2.26.2 > > _______________________________________________ > dev mailing list > [email protected] > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
