Welcome! Log In Create A New Profile

Advanced

Re: [PATCH 3 of 3] QUIC: keep stream sockaddr and addr_text constant

Roman Arutyunyan
May 10, 2023 01:48PM
Hi,

On Tue, May 02, 2023 at 04:34:15PM +0400, Roman Arutyunyan wrote:
> # HG changeset patch
> # User Roman Arutyunyan <arut@nginx.com>
> # Date 1682679819 -14400
> # Fri Apr 28 15:03:39 2023 +0400
> # Branch quic
> # Node ID 43f0ceffa227a33e5c5ceb35b77f9a1f86dd2481
> # Parent cdc41ec778ffae822fefce639e67f2f57e3667f0
> QUIC: keep stream sockaddr and addr_text constant.
>
> HTTP and Stream variables $remote_addr and $binary_remote_addr rely on
> constant client address, particularly because they are cacheable.
> However, QUIC client may migrate to a new address. While there's no perfect
> way to handle this, the proposed solution is to copy client address to QUIC
> stream at stream creation. Previously, the address was only referenced, which
> could result in changing it while stream was active, which in turn would lead
> to broken cached variables values, since address length is cached as well.

While testing this, it was found that $remote_addr truncation happens at the
QUIC level since the addr_text string is copied by value and retains the old
length after migration. The new commit log:

QUIC: keep stream sockaddr and addr_text constant.

HTTP and Stream variables $remote_addr and $binary_remote_addr rely on
constant client address, particularly because they are cacheable.
However, QUIC client may migrate to a new address. While there's no perfect
way to handle this, the proposed solution is to copy client address to QUIC
stream at stream creation.

The change also fixes truncated $remote_addr if migration happened while the
stream was active. The reason is addr_text string was copied to stream by
value.

[..]

--
Roman Arutyunyan
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 3] QUIC post-migration address issues

Roman Arutyunyan 395 May 02, 2023 08:36AM

[PATCH 1 of 3] QUIC: fixed addr_text after migration (ticket #2488)

Roman Arutyunyan 90 May 02, 2023 08:36AM

[PATCH 2 of 3] QUIC: set c->socklen for streams

Roman Arutyunyan 91 May 02, 2023 08:36AM

[PATCH 3 of 3] QUIC: keep stream sockaddr and addr_text constant

Roman Arutyunyan 132 May 02, 2023 08:36AM

Re: [PATCH 3 of 3] QUIC: keep stream sockaddr and addr_text constant

Roman Arutyunyan 84 May 10, 2023 01:48PM

Re: [PATCH 3 of 3] QUIC: keep stream sockaddr and addr_text constant

Sergey Kandaurov 85 May 11, 2023 06:28AM

Re: [PATCH 3 of 3] QUIC: keep stream sockaddr and addr_text constant

Roman Arutyunyan 103 May 11, 2023 11:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready