summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-03-11 17:57:14 +0000
committerrubidium <rubidium@openttd.org>2010-03-11 17:57:14 +0000
commit6b35de215cac57c773cf32c7bc0c6adaf59d3df1 (patch)
treef6c72a12ab40dbc3340e9eaf420d6a6864159a3d /src/network/core
parentf7eb527a372e69332970a5fe9d3229c185aeddea (diff)
downloadopenttd-6b35de215cac57c773cf32c7bc0c6adaf59d3df1.tar.xz
(svn r19385) -Fix [FS#3684]: [IPv6] Netmask calculations were wrong if cidr >= 32.
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/address.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp
index 4e1237577..586ee863a 100644
--- a/src/network/core/address.cpp
+++ b/src/network/core/address.cpp
@@ -161,7 +161,7 @@ bool NetworkAddress::IsInNetmask(char *netmask)
while (cidr > 0) {
uint32 msk = cidr >= 32 ? (uint32)-1 : htonl(-(1 << (32 - cidr)));
- if ((*mask & msk) != (*ip & msk)) return false;
+ if ((*mask++ & msk) != (*ip++ & msk)) return false;
cidr -= 32;
}