aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-03 17:12:58 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-03 17:13:24 +0000
commitfcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3 (patch)
treefbfa770df353d3133b7069a95402b3d474337437 /src/libutil/addr.c
parentf4b315188ef4f1cb1999872defd1d1f558dbc2e0 (diff)
downloadrspamd-fcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3.tar.gz
rspamd-fcefb0a6d71faaa1b47f5f5f6a3961d41e94cfc3.zip
Fix IPv4 loopback detection
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r--src/libutil/addr.c3
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;
}
}