MIME-Version: 1.0 From: Jon Chiappetta Date: Wed, 19 Nov 2025 09:19:35 -0500 Message-ID: Content-Type: multipart/alternative; boundary="000000000000c35d8d0643f345d6" References: Subject: [Openvpn-devel] Old/New IP - Logic Redo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel@lists.sourceforge.net --000000000000c35d8d0643f345d6 Content-Type: text/plain; charset="UTF-8" Hi all, This is something I noticed recently with potential connection interruptions which could occur which the original older code checked for! https://github.com/OpenVPN/openvpn/pull/910 There was an update pushed earlier this year which undid some important logic in terms of learning/unlearning the ifconfig IP address. The older original code would check that the new/old IPs don't match first before performing that logic. I believe this was important and correct because it could cause connection interruptions during the learn/unlearn process if the IP address has stayed the same! ``` commit 5e4c9a69eaf9d32e85613bd71ed219fdbb062d34 Author: Marco Baffo Date: Fri Oct 17 22:19:12 2025 +0200 ... -update_vhash(struct multi_context *m, struct multi_instance *mi, const char *old_ip, const char *old_ipv6) +update_vhash(struct multi_context *m, struct multi_instance *mi, const char *new_ip, const char *new_ipv6) { - struct in_addr addr; - struct in6_addr new_ipv6; - - if ((mi->context.options.ifconfig_local && (!old_ip || strcmp(old_ip, mi->context.options.ifconfig_local))) - && inet_pton(AF_INET, mi->context.options.ifconfig_local, &addr) == 1) + if (new_ip) { ``` Thanks, Jon C --000000000000c35d8d0643f345d6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

This is something I noticed rec= ently with potential connection interruptions which could occur which the o= riginal older code checked for!


There was an update pushed earlier = this year which undid some important logic in terms of learning/unlearning = the ifconfig IP address. The older original code would check that the new/o= ld IPs don't match first before performing that logic. I believe this w= as important and correct because it could cause connection interruptions du= ring the learn/unlearn process if the IP address has stayed the same!
```
commit 5e4c9a69eaf9d32e85613bd71ed219fdbb062d34
Author: Marco B= affo <marco@...2726...>
Da= te: =C2=A0 Fri Oct 17 22:19:12 2025 +0200
...
-update_vhash(struct mu= lti_context *m, struct multi_instance *mi, const char *old_ip, const char *= old_ipv6)
+update_vhash(struct multi_context *m, struct multi_instance *= mi, const char *new_ip, const char *new_ipv6)
=C2=A0{
- =C2=A0 =C2=A0= struct in_addr addr;
- =C2=A0 =C2=A0struct in6_addr new_ipv6;
-
- = =C2=A0 =C2=A0if ((mi->context.options.ifconfig_local && (!old_ip= || strcmp(old_ip, mi->context.options.ifconfig_local)))
- =C2=A0 =C2= =A0 =C2=A0 =C2=A0&& inet_pton(AF_INET, mi->context.options.ifcon= fig_local, &addr) =3D=3D 1)
+ =C2=A0 =C2=A0if (new_ip)
=C2=A0 =C2= =A0 =C2=A0{
```

Thanks,
Jon C

--000000000000c35d8d0643f345d6--