Re: [Openvpn-devel] [PATCH] Fix environment variables for p2mp-assigned IPv6 addresses.

2020-07-15 Thread Gert Doering
Hi,

On Wed, Jul 15, 2020 at 01:31:32PM +0200, Gert Doering wrote:
> commit a8f8b926718 introduces $ENV{ifconfig_pool_local_ip6} and
> $ENV{ifconfig_pool_remote_ip6}, but instead of properly setting them,
> the code overwrites the IPv4 variables, $ENV{ifconfig_pool_remote}
> and $ENV{ifconfig_pool_local}.
> 
> Trivial fix.
> 
> Signed-off-by: Gert Doering 

And while the fix looks trivially right, it isn't... setenv_in6_addr()
calls setenv_sockaddr() which does

openvpn_snprintf(name_buf, sizeof(name_buf), "%s_ip6", name_prefix);
getnameinfo(>addr.sa, sizeof(struct sockaddr_in6),
buf, sizeof(buf), NULL, 0, NI_NUMERICHOST);

so with the patch, I end up with

ifconfig_pool_local_ip6_ip6=fd00:abcd:204:5::1
ifconfig_pool_remote_ip6_ip6=fd00:abcd:204:5::2

seems the original code is not easy to understand, but correct.

So, NACK.

Taking "talking to myself" to new levels :-)

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
 Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany g...@greenie.muc.de


signature.asc
Description: PGP signature
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH] Fix environment variables for p2mp-assigned IPv6 addresses.

2020-07-15 Thread Arne Schwabe
Am 15.07.20 um 13:31 schrieb Gert Doering:
> commit a8f8b926718 introduces $ENV{ifconfig_pool_local_ip6} and
> $ENV{ifconfig_pool_remote_ip6}, but instead of properly setting them,
> the code overwrites the IPv4 variables, $ENV{ifconfig_pool_remote}
> and $ENV{ifconfig_pool_local}.
> 
> Trivial fix.
>

Acked-By: Arne Schwabe 



signature.asc
Description: OpenPGP digital signature
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH] Fix environment variables for p2mp-assigned IPv6 addresses.

2020-07-15 Thread Gert Doering
commit a8f8b926718 introduces $ENV{ifconfig_pool_local_ip6} and
$ENV{ifconfig_pool_remote_ip6}, but instead of properly setting them,
the code overwrites the IPv4 variables, $ENV{ifconfig_pool_remote}
and $ENV{ifconfig_pool_local}.

Trivial fix.

Signed-off-by: Gert Doering 
---
 src/openvpn/multi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index fe8fcd50..01da8c73 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -1624,11 +1624,11 @@ multi_set_virtual_addr_env(struct multi_instance *mi)
 if (mi->context.c2.push_ifconfig_ipv6_defined)
 {
 setenv_in6_addr(mi->context.c2.es,
-"ifconfig_pool_remote",
+"ifconfig_pool_remote_ip6",
 >context.c2.push_ifconfig_ipv6_local,
 SA_SET_IF_NONZERO);
 setenv_in6_addr(mi->context.c2.es,
-"ifconfig_pool_local",
+"ifconfig_pool_local_ip6",
 >context.c2.push_ifconfig_ipv6_remote,
 SA_SET_IF_NONZERO);
 setenv_int(mi->context.c2.es,
-- 
2.26.2



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