[PATCH 05/11] Socket: removed useless port < 1 check.

Alejandro Colomar alx.manpages at gmail.com
Thu Jun 16 15:52:42 UTC 2022



On 6/16/22 03:00, Andrew Clayton wrote:
> In src/nxt_sockaddr.c::nxt_job_sockaddr_inet_parse() there is a check
> that port > 0 then there is a check that port < 1 || port > 65535, well
> we _know_ it can't be less than 1.

Reviewed-by: Alejandro Colomar <alx.manpages at gmail.com>

> ---
>   src/nxt_sockaddr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/nxt_sockaddr.c b/src/nxt_sockaddr.c
> index 730428e..71e50e3 100644
> --- a/src/nxt_sockaddr.c
> +++ b/src/nxt_sockaddr.c
> @@ -1090,7 +1090,7 @@ nxt_job_sockaddr_inet_parse(nxt_job_sockaddr_parse_t *jbs)
>           port = nxt_int_parse(host, length);
>   
>           if (port > 0) {
> -            if (port < 1 || port > 65535) {
> +            if (port > 65535) {
>                   goto invalid_port;
>               }
>   

-- 
Alejandro Colomar
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20220616/db8f0711/attachment.bin>


More information about the unit mailing list