summaryrefslogtreecommitdiff
path: root/networkPrefix.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-02-28 23:38:58 +0000
committerOthmar Gsenger <otti@anytun.org>2008-02-28 23:38:58 +0000
commitd790f4c83fe3fe090b74df29615dcd2d06f3aa38 (patch)
treeffb80686d6a1f1933c93a9ec67e03335d9dd4ec8 /networkPrefix.cpp
parentmulticonnection sync fix (diff)
fixed network prefix
Diffstat (limited to 'networkPrefix.cpp')
-rw-r--r--networkPrefix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/networkPrefix.cpp b/networkPrefix.cpp
index ee6d9e9..5070dec 100644
--- a/networkPrefix.cpp
+++ b/networkPrefix.cpp
@@ -49,12 +49,12 @@ void NetworkPrefix::setNetworkPrefixLength(uint8_t length )
{
in_addr v4addr;
v4addr.s_addr=0xFFFFFFFF;
- *this &= (NetworkAddress(v4addr)<<length);
+ *this &= (NetworkAddress(v4addr)<<(32-length));
} else if (network_address_type_==ipv6) {
in6_addr v6addr;
for(int i=0;i<4;i++)
ipv6_address_.s6_addr32[i]=0xFFFFFFFF;
- *this &= (NetworkAddress(v6addr)<<length);
+ *this &= (NetworkAddress(v6addr)<<(128-length));
} else if (network_address_type_==ethernet) {
//TODO
} else {