]> source.dussan.org Git - rspamd.git/commitdiff
Fix IPv4 loopback detection
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 3 Jan 2016 17:12:58 +0000 (17:12 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 3 Jan 2016 17:13:24 +0000 (17:13 +0000)
src/libutil/addr.c

index d8dec0b97929f997230df87b1ef3bbd5c80db854..3eeef8e44cfdf7fb6d75006f525f997a524ddaf5 100644 (file)
@@ -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;
                        }
                }