diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 23:38:58 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 23:38:58 +0000 |
commit | d790f4c83fe3fe090b74df29615dcd2d06f3aa38 (patch) | |
tree | ffb80686d6a1f1933c93a9ec67e03335d9dd4ec8 /networkPrefix.cpp | |
parent | multiconnection sync fix (diff) |
fixed network prefix
Diffstat (limited to 'networkPrefix.cpp')
-rw-r--r-- | networkPrefix.cpp | 4 |
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 { |