summaryrefslogtreecommitdiff
path: root/src/networkAddress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/networkAddress.cpp')
-rw-r--r--src/networkAddress.cpp4
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