summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_route_addr.c
diff options
context:
space:
mode:
authorOisin Canty <o.canty@f5.com>2021-08-12 08:23:09 +0000
committerOisin Canty <o.canty@f5.com>2021-08-12 08:23:09 +0000
commit73ea6a1c3a7a4a7f3ab14230b80e783e57a7d830 (patch)
treedd6311ed175e5f02c9ad36ca89f5ac6256024748 /src/nxt_http_route_addr.c
parent9988569beafce7f587f17a9ef710b76e9bfa3165 (diff)
downloadunit-73ea6a1c3a7a4a7f3ab14230b80e783e57a7d830.tar.gz
unit-73ea6a1c3a7a4a7f3ab14230b80e783e57a7d830.tar.bz2
Introduced nxt_sockaddr_parse_optport() for addresses w/o ports.
Diffstat (limited to 'src/nxt_http_route_addr.c')
-rw-r--r--src/nxt_http_route_addr.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/nxt_http_route_addr.c b/src/nxt_http_route_addr.c
index 6d4955ed..2907a902 100644
--- a/src/nxt_http_route_addr.c
+++ b/src/nxt_http_route_addr.c
@@ -8,7 +8,6 @@
#include <nxt_http_route_addr.h>
-static nxt_bool_t nxt_str_looks_like_ipv6(const nxt_str_t *str);
#if (NXT_INET6)
static nxt_bool_t nxt_valid_ipv6_blocks(u_char *c, size_t len);
#endif
@@ -57,7 +56,7 @@ nxt_http_route_addr_pattern_parse(nxt_mp_t *mp,
goto parse_port;
}
- if (nxt_str_looks_like_ipv6(&addr)) {
+ if (nxt_inet6_probe(&addr)) {
#if (NXT_INET6)
u_char *end;
uint8_t i;
@@ -304,22 +303,6 @@ parse_port:
}
-static nxt_bool_t
-nxt_str_looks_like_ipv6(const nxt_str_t *str)
-{
- u_char *colon, *end;
-
- colon = nxt_memchr(str->start, ':', str->length);
-
- if (colon != NULL) {
- end = str->start + str->length;
- colon = nxt_memchr(colon + 1, ':', end - (colon + 1));
- }
-
- return (colon != NULL);
-}
-
-
#if (NXT_INET6)
static nxt_bool_t