summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_sockaddr.c
diff options
context:
space:
mode:
authorAxel Duch <axel.duch@nginx.com>2019-12-24 13:58:10 +0000
committerAxel Duch <axel.duch@nginx.com>2019-12-24 13:58:10 +0000
commit8677bf8d41e002310971fddbc5e45c64034afc2f (patch)
tree0560a4f60031459c16ed19980668f86d66175bed /src/nxt_sockaddr.c
parent26ee4cb6c8a2248f0f7c99d8c622c86a52bf197a (diff)
downloadunit-8677bf8d41e002310971fddbc5e45c64034afc2f.tar.gz
unit-8677bf8d41e002310971fddbc5e45c64034afc2f.tar.bz2
Router: introducing routing on client address.
Diffstat (limited to '')
-rw-r--r--src/nxt_sockaddr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nxt_sockaddr.c b/src/nxt_sockaddr.c
index 57dfbfa6..af696a6b 100644
--- a/src/nxt_sockaddr.c
+++ b/src/nxt_sockaddr.c
@@ -1140,6 +1140,10 @@ nxt_inet_addr(u_char *buf, size_t length)
in_addr_t addr;
nxt_uint_t digit, octet, dots;
+ if (nxt_slow_path(*(buf + length - 1) == '.')) {
+ return INADDR_NONE;
+ }
+
addr = 0;
octet = 0;
dots = 0;