nullable_strcmp() was added to lib/ovn-util.h together with the ECMP
id ordering.  Use it in the remaining callers of the OVS helper so that
OVN has a single way of comparing strings that may be NULL.  Two NULLs
still compare equal, so there is no functional change.

Suggested-by: Rosemarie O'Riorden <[email protected]>
Signed-off-by: Lucas Vargas Dias <[email protected]>
---
v2:
  - New patch, suggested in the v1 review.

 northd/lb.c        | 4 ++--
 northd/lflow-mgr.c | 2 +-
 northd/northd.c    | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/northd/lb.c b/northd/lb.c
index 5ff9d1fad..eeeb90b5c 100644
--- a/northd/lb.c
+++ b/northd/lb.c
@@ -345,8 +345,8 @@ ovn_northd_lb_init(struct ovn_northd_lb *lb,
                    const struct nbrec_load_balancer *nbrec_lb)
 {
     bool template = smap_get_bool(&nbrec_lb->options, "template", false);
-    bool is_udp = nullable_string_is_equal(nbrec_lb->protocol, "udp");
-    bool is_sctp = nullable_string_is_equal(nbrec_lb->protocol, "sctp");
+    bool is_udp = !nullable_strcmp(nbrec_lb->protocol, "udp");
+    bool is_sctp = !nullable_strcmp(nbrec_lb->protocol, "sctp");
     int address_family = !strcmp(smap_get_def(&nbrec_lb->options,
                                               "address-family", "ipv4"),
                                  "ipv4")
diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c
index deceadb74..ffe6e2e45 100644
--- a/northd/lflow-mgr.c
+++ b/northd/lflow-mgr.c
@@ -1131,7 +1131,7 @@ ovn_lflow_equal(const struct ovn_lflow *a, const struct 
ovn_stage *stage,
             && a->priority == priority
             && !strcmp(a->match, match)
             && !strcmp(a->actions, actions)
-            && nullable_string_is_equal(a->ctrl_meter, ctrl_meter)
+            && !nullable_strcmp(a->ctrl_meter, ctrl_meter)
             && a->acl_ct_translation == acl_ct_translation);
 }
 
diff --git a/northd/northd.c b/northd/northd.c
index f37040b57..3fb75a423 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -12596,8 +12596,7 @@ parsed_route_lookup(struct hmap *routes, size_t hash,
             continue;
         }
 
-        if (!nullable_string_is_equal(pr->lrp_addr_s,
-                                      new_pr->lrp_addr_s)) {
+        if (nullable_strcmp(pr->lrp_addr_s, new_pr->lrp_addr_s)) {
             continue;
         }
 
-- 
2.43.0


-- 




_'Esta mensagem é direcionada apenas para os endereços constantes no 
cabeçalho inicial. Se você não está listado nos endereços constantes no 
cabeçalho, pedimos-lhe que desconsidere completamente o conteúdo dessa 
mensagem e cuja cópia, encaminhamento e/ou execução das ações citadas estão 
imediatamente anuladas e proibidas'._


* **'Apesar do Magazine Luiza tomar 
todas as precauções razoáveis para assegurar que nenhum vírus esteja 
presente nesse e-mail, a empresa não poderá aceitar a responsabilidade por 
quaisquer perdas ou danos causados por esse e-mail ou por seus anexos'.*



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

Reply via email to