*strcmp(old_ip, mi->context.options.ifconfig_local) !*

On Wed, Nov 19, 2025 at 9:54 AM Jon Chiappetta <[email protected]> wrote:

> Hi Gert,
>
> Yes, that is correct, it does impact the multi-threaded operation,
> however, the older logic has a strcmp between the old IP and the new IP
> before performing the learn and unlearn logic in the update_vhash function
> which is what SHOULD happen, this is important and correct. Why would you
> want to waste cycles and operations doing that when the IPs haven't even
> changed or differed in value? It doesn't make any logical sense either way
> even in single threaded operation...
>
> Thanks,
> Jon C
>
>
> On Wed, Nov 19, 2025 at 9:43 AM Gert Doering <[email protected]> wrote:
>
>> Hi,
>>
>> On Wed, Nov 19, 2025 at 09:19:35AM -0500, Jon Chiappetta via
>> Openvpn-devel wrote:
>> > 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
>>
>> Yeah, but, no.
>>
>> Since our code is single-threaded, there is no time frame between
>> "unlearn" and "relearn" where a packet could come in and be dropped, due
>> to "address not known".
>>
>> So yes, on a PUSH_UPDATE with "the same ifconfig again", we do more work
>> than we would have to do, but it has no adverse effects - and if you are
>> worried about that, then do not send PUSH_UPDATE with unchanged configs
>> (given that the client would do a full tun restart on receiving
>> PUSH_UPDATE,
>> this has way more impact than on the server).
>>
>>
>> > 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!
>>
>> The older code did not do proper unlearning at all, so was obviously not
>> correct.
>>
>> 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
>> [email protected]
>>
>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to