diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-03 17:12:58 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-03 17:13:24 +0000 |
commit | fcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3 (patch) | |
tree | fbfa770df353d3133b7069a95402b3d474337437 /src/libutil/addr.c | |
parent | f4b315188ef4f1cb1999872defd1d1f558dbc2e0 (diff) | |
download | rspamd-fcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3.tar.gz rspamd-fcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3.zip |
Fix IPv4 loopback detection
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r-- | src/libutil/addr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c index d8dec0b97..3eeef8e44 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -1345,7 +1345,8 @@ rspamd_inet_address_is_local (const rspamd_inet_addr_t *addr) } else { if (addr->af == AF_INET) { - if (addr->u.in.addr.s4.sin_addr.s_addr == INADDR_LOOPBACK) { + if ((ntohl (addr->u.in.addr.s4.sin_addr.s_addr) & 0xff000000) + == 0x7f000000) { return TRUE; } } |