summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2022-09-27 11:31:16 +0400
committerRoman Arutyunyan <arut@nginx.com>2022-09-27 11:31:16 +0400
commitf27af85016f357048cd097a8779a22517fd62741 (patch)
treee3b9b1474e05b1b878540135830b7e6be484beb8
parent50e3ff8a006100feaa0666cf5e4f9fd5fdcfb721 (diff)
downloadnginx-f27af85016f357048cd097a8779a22517fd62741.tar.gz
Added type cast to ngx_proxy_protocol_parse_uint16().
The cast is added to make ngx_proxy_protocol_parse_uint16() similar to ngx_proxy_protocol_parse_uint32().
-rw-r--r--src/core/ngx_proxy_protocol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ngx_proxy_protocol.c b/src/core/ngx_proxy_protocol.c
index dfbd04bc9..2d9c095b1 100644
--- a/src/core/ngx_proxy_protocol.c
+++ b/src/core/ngx_proxy_protocol.c
@@ -13,7 +13,9 @@
#define NGX_PROXY_PROTOCOL_AF_INET6 2
-#define ngx_proxy_protocol_parse_uint16(p) ((p)[0] << 8 | (p)[1])
+#define ngx_proxy_protocol_parse_uint16(p) \
+ ( ((uint16_t) (p)[0] << 8) \
+ + ( (p)[1]) )
#define ngx_proxy_protocol_parse_uint32(p) \
( ((uint32_t) (p)[0] << 24) \