Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fixed port ranges support in the listen directive

Maxim Dounin
December 26, 2022 05:58PM
Hello!

On Fri, Dec 23, 2022 at 07:27:04PM +0400, Sergey Kandaurov wrote:

> > On 18 Dec 2022, at 22:36, Valentin V. Bartenev <vbart@wbsrv.ru> wrote:
> >
> > # HG changeset patch
> > # User Valentin Bartenev <vbart@wbsrv.ru>
> > # Date 1671388142 -10800
> > # Sun Dec 18 21:29:02 2022 +0300
> > # Node ID 2af1287d2da744335932f6dca345618f7b80d1c1
> > # Parent 3108d4d668e4b907868b815f0441d4c893bf4188
> > Fixed port ranges support in the listen directive.
> >
> > Ports difference must be respected when checking addresses for duplicates,
> > otherwise configurations like this are broken:
> >
> > listen 127.0.0.1:6000-6005
> >
> > It was broken by 4cc2bfeff46c (nginx 1.23.3).
> >
>
> Thanks for the report, the patch looks good, pushed.
>
> It could've been caught by tests, if they were not skipped by default
> due to using wildcard addresses (as you recall, changes went there too),
> a measure to prevent from running on a box with external addresses.
> Nowadays, it is rather historic, it's much easier to setup an isolated
> environment. Probably it's time to move on to 21st century and start
> running nginx tests with wildcard listening sockets unconditionally.
> Meanwhile, I've made some changes to have a better chance to catch this.

Testing port ranges certainly do not depend on using the wildcard
address. It's more about properly structuring tests.

Note though that even with proper structuring and/or with
TEST_NGINX_UNSAFE the particular test is likely to be skipped with
parallel test execution since the test requires two consecutive
ports, which are unlikely to be allocated with parallel tests.

Either way, I'm certainly against the idea of listening on the
wildcard address by default in tests. The original idea is that
tests should listen on local addresses only, so it should be
reasonably safe to run tests on any host. And I would rather
preserve this behaviour.

If tests on wildcard addresses are indeed important, it might be a
good idea to introduce a separate switch to allow such tests
instead of requiring TEST_NGINX_UNSAFE. I don't think this is
needed in this particular case though, and properly re-structuring
tests should be sufficient (at least assuming no parallel test
execution; addressing this would require some port ranges
support it port allocation infrastructure).

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fixed port ranges support in the listen directive

Valentin V. Bartenev 512 December 18, 2022 01:40PM

Re: [PATCH] Fixed port ranges support in the listen directive

Maxim Dounin 95 December 18, 2022 06:50PM

Re: [PATCH] Fixed port ranges support in the listen directive

Sergey Kandaurov 141 December 23, 2022 10:28AM

Re: [PATCH] Fixed port ranges support in the listen directive

Maxim Dounin 134 December 26, 2022 05:58PM



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

Online Users

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