[PATCH] Fixed port ranges support in the listen directive

Sergey Kandaurov pluknet at nginx.com
Fri Dec 23 15:27:04 UTC 2022


> On 18 Dec 2022, at 22:36, Valentin V. Bartenev <vbart at wbsrv.ru> wrote:
> 
> # HG changeset patch
> # User Valentin Bartenev <vbart at 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.

-- 
Sergey Kandaurov


More information about the nginx-devel mailing list