aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-03 13:35:41 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-03 13:35:41 +0000
commit1d2a2bc086198a2940652b35259c1603e4511fc0 (patch)
tree8f4536f1aaa558b19dcb64ccfd1d9b45ec9393ab /src/libutil
parent263bdbf4d38e32a04518764d854504036a964d04 (diff)
downloadrspamd-1d2a2bc086198a2940652b35259c1603e4511fc0.tar.gz
rspamd-1d2a2bc086198a2940652b35259c1603e4511fc0.zip
[Minor] Fix mapped v6 addresses
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/addr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c
index 992eba9a2..fa20ff6fe 100644
--- a/src/libutil/addr.c
+++ b/src/libutil/addr.c
@@ -582,10 +582,9 @@ rspamd_inet_address_v6_maybe_map (const struct sockaddr_in6 *sin6)
if (memcmp ((const guint8 *)&sin6->sin6_addr, mask, sizeof (mask)) == 0) {
p = (const guint8 *)&sin6->sin6_addr;
- if ((p[11] == 0 && p[12] == 0) ||
- (p[11] == 0xff && p[12] == 0xff)) {
+ if ((p[10] == 0xff && p[11] == 0xff)) {
addr = rspamd_inet_addr_create (AF_INET);
- memcpy (&addr->u.in.addr.s4.sin_addr, &p[13],
+ memcpy (&addr->u.in.addr.s4.sin_addr, &p[12],
sizeof (struct in_addr));
}
else {