Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Stream pass: disabled passing from or to udp

Sergey Kandaurov
May 03, 2024 12:26PM
> On 26 Apr 2024, at 15:15, Roman Arutyunyan <arut@nginx.com> wrote:
>
> # HG changeset patch
> # User Roman Arutyunyan <arut@nginx.com>
> # Date 1714057362 -14400
> # Thu Apr 25 19:02:42 2024 +0400
> # Branch stable-1.26

wrong branch

> # Node ID a60cd9c99efcc1204e6d395104beb39883308c93
> # Parent cdf74ac25b47ec928b53aa82ccc1c3d288a2f81c
> Stream pass: disabled passing from or to udp.
>
> Passing from udp was not possible for the most part due to preread buffer
> restriction. Passing to udp could occasionally work, but the connection would
> still be bound to the orignial listen rbtree, which prevented it from being

typo in "original"

> deleted on connection closure.
>
> Also, passing to a QUIC listen socket is disabled by this change as well.

disabled for the same reasons?

>
> diff --git a/src/stream/ngx_stream_pass_module.c b/src/stream/ngx_stream_pass_module.c
> --- a/src/stream/ngx_stream_pass_module.c
> +++ b/src/stream/ngx_stream_pass_module.c
> @@ -83,6 +83,11 @@ ngx_stream_pass_handler(ngx_stream_sessi
>
> c->log->action = "passing connection to port";
>
> + if (c->type == SOCK_DGRAM) {
> + ngx_log_error(NGX_LOG_ERR, c->log, 0, "cannot pass udp connection");
> + goto failed;
> + }
> +
> if (c->buffer && c->buffer->pos != c->buffer->last) {
> ngx_log_error(NGX_LOG_ERR, c->log, 0,
> "cannot pass connection with preread data");
> @@ -217,6 +222,10 @@ ngx_stream_pass_cleanup(void *data)
> static ngx_int_t
> ngx_stream_pass_match(ngx_listening_t *ls, ngx_addr_t *addr)
> {
> + if (ls->type == SOCK_DGRAM) {
> + return NGX_DECLINED;
> + }
> +
> if (!ls->wildcard) {
> return ngx_cmp_sockaddr(ls->sockaddr, ls->socklen,
> addr->sockaddr, addr->socklen, 1);

The change is good.

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

[PATCH] Stream pass: disabled passing from or to udp

Roman Arutyunyan 183 April 26, 2024 07:18AM

Re: [PATCH] Stream pass: disabled passing from or to udp

Sergey Kandaurov 15 May 03, 2024 12:26PM

Re: [PATCH] Stream pass: disabled passing from or to udp

Roman Arutyunyan 16 May 03, 2024 12:32PM

Re: [PATCH] Stream pass: disabled passing from or to udp

Sergey Kandaurov 33 May 03, 2024 12:34PM



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

Online Users

Guests: 298
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