diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-03 13:35:41 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-03 13:35:41 +0000 |
commit | 1d2a2bc086198a2940652b35259c1603e4511fc0 (patch) | |
tree | 8f4536f1aaa558b19dcb64ccfd1d9b45ec9393ab /src/libutil | |
parent | 263bdbf4d38e32a04518764d854504036a964d04 (diff) | |
download | rspamd-1d2a2bc086198a2940652b35259c1603e4511fc0.tar.gz rspamd-1d2a2bc086198a2940652b35259c1603e4511fc0.zip |
[Minor] Fix mapped v6 addresses
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/addr.c | 5 |
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 { |