MIME-Version: 1.0 References: In-Reply-To: From: Jon Chiappetta Date: Wed, 19 Nov 2025 09:54:30 -0500 Message-ID: Content-Type: multipart/alternative; boundary="0000000000009b1cde0643f3c254" Subject: Re: [Openvpn-devel] Old/New IP - Logic Redo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gert Doering Cc: openvpn-devel@lists.sourceforge.net --0000000000009b1cde0643f3c254 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFAM Gert Doering wrot= e: > 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 > gert@...1296... > --0000000000009b1cde0643f3c254 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 l= ogic in the update_vhash function which is what SHOULD happen, this is impo= rtant 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&#= 39;t make any logical sense either way even in single threaded operation...=

Thanks,
Jon C


On Wed, Nov 19, 2025 at 9:43=E2=80=AFAM Gert Doering <<= a href=3D"mailto:gert@...1296...">gert@...1296...> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pa= dding-left:1ex">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 an= d be dropped, due
to "address not known".

So yes, on a PUSH_UPDATE with "the same ifconfig again", we do mo= re 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 importan= t
> logic in terms of learning/unlearning the ifconfig IP address. The old= er
> original code would check that the new/old IPs don't match first b= efore
> performing that logic. I believe this was important and correct becaus= e 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
=C2=A0feed honest figures into a computer, honest figures come out. Never d= oubted
=C2=A0it myself till I met a computer with a sense of humor."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Robert A. Heinlein, The Moon is a Harsh Mist= ress

Gert Doering - Munich, Germany=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gert@...1296...
--0000000000009b1cde0643f3c254--