On 10/19/22 07:42, Ales Musil wrote:
> The current code was parsing the ip twice, once for
> the "inet_parse_active" and second time by calling
> either "ip_parse" or "ipv6_parse". Avoid that by
> getting the "in6_addr" directly from "sockaddr_storage".
> 
> Acked-by: Numan Siddique <[email protected]>
> Signed-off-by: Ales Musil <[email protected]>
> ---
> v2: Rebase on top of current main
>     Address comment from Numan
> ---

Thanks Ales and Numan!  I pushed this to the main branch with the following
minor change to initialize output arguments in the same order on both
branches:

diff --git a/lib/ovn-util.c b/lib/ovn-util.c
index a89af6f28d..5dca727146 100644
--- a/lib/ovn-util.c
+++ b/lib/ovn-util.c
@@ -797,9 +797,9 @@ ip_address_and_port_from_lb_key(const char *key, char 
**ip_address,
         VLOG_WARN_RL(&rl, "bad ip address or port for load balancer key %s",
                      key);
         *ip_address = NULL;
+        memset(ip, 0, sizeof(*ip));
         *port = 0;
         *addr_family = 0;
-        memset(ip, 0, sizeof(*ip));
         return false;
     }


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

Reply via email to