diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-10-17 17:46:43 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-10-17 17:46:43 +0000 |
commit | 7d3fc543ea73791c6b26c48d476ff989683d8bb7 (patch) | |
tree | ed409096e3fbbdd88d0d844d3ef4344fede055e4 /src | |
parent | moved acn presentation files to folder acn (diff) |
fixed ipv6 shift operator
Diffstat (limited to 'src')
-rw-r--r-- | src/networkAddress.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/networkAddress.cpp b/src/networkAddress.cpp index d8e0646..5dc1f9f 100644 --- a/src/networkAddress.cpp +++ b/src/networkAddress.cpp @@ -157,11 +157,11 @@ NetworkAddress NetworkAddress::operator<<(uint8_t shift) const { #if defined(__GNUC__) && defined(__linux__) new_v6_addr.s6_addr32[i]=ipv6_address_.s6_addr32[i]<<1; - if (i<3 && ipv6_address_.s6_addr32[i+1] || uint32_t (0x80000000)) + if (i<3 && (ipv6_address_.s6_addr32[i+1] & uint32_t (0x80000000))) new_v6_addr.s6_addr32[i] &=1; #elif defined(__GNUC__) && defined(__OpenBSD__) new_v6_addr.__u6_addr.__u6_addr32[i]=ipv6_address_.__u6_addr.__u6_addr32[i]<<1; - if (i<3 && ipv6_address_.__u6_addr.__u6_addr32[i+1] || uint32_t (0x80000000)) + if (i<3 && (ipv6_address_.__u6_addr.__u6_addr32[i+1] & uint32_t (0x80000000))) new_v6_addr.__u6_addr.__u6_addr32[i] &=1; #else #error Target not supported |