Hi,

On 05/07/2022 14:30, Heiko Hund wrote:
On Freitag, 24. Juni 2022 10:37:57 CEST Antonio Quartulli wrote:
+    /* These inet_pton conversion are fatal since options.c already
implements
+     * checks to have only valid addresses when setting the
options */
+    if (c->options.ifconfig_ipv6_remote)
+    {
+        if (inet_pton(AF_INET6, c->options.ifconfig_ipv6_remote,
&remote_ip6) != 1) +        {
+            msg(M_FATAL,
+                "DCO peer init: problem converting IPv6 ifconfig remote
address %s to binary", +                c->options.ifconfig_ipv6_remote);
+        }
+        remote_addr6 = &remote_ip6;
+    }

I'm undecided if these fatal errors are justified with respect to defensive
programming or overly paranoid, because they will never appear.

I'd say they are simply ASSERTs in disguise :-)

When a function returns an error I think it is always good habit to check it..then why not printing something meaningful at this point?

Cheers,






_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


--
Antonio Quartulli


_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to