From df13c052a8cd49d956a654e34d7c2a1ac74b5ce6 Mon Sep 17 00:00:00 2001 From: Mariusz Suchora Date: Mon, 19 Mar 2018 14:04:45 +0100 Subject: [PATCH] Improve UDPv6 code portability Signed-off-by: Mariusz Suchora --- MQTTSNGateway/src/linux/udp6/SensorNetwork.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MQTTSNGateway/src/linux/udp6/SensorNetwork.cpp b/MQTTSNGateway/src/linux/udp6/SensorNetwork.cpp index e4f0039..5e56fff 100644 --- a/MQTTSNGateway/src/linux/udp6/SensorNetwork.cpp +++ b/MQTTSNGateway/src/linux/udp6/SensorNetwork.cpp @@ -14,6 +14,7 @@ * Contributors: * Benjamin Aigner - Adaption of the UDPv4 code to use UDPv6 * Tomoaki Yamaguchi - initial API and implementation and/or initial documentation + * Tieto Poland Sp. z o.o. - improve portability **************************************************************************************/ #include #include @@ -94,10 +95,10 @@ char* SensorNetAddress::getAddress(void) bool SensorNetAddress::isMatch(SensorNetAddress* addr) { return ((this->_portNo == addr->_portNo) && \ - (this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[0] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[0]) && \ - (this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[1] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[1]) && \ - (this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[2] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[2]) && \ - (this->_IpAddr.sin6_addr.__in6_u.__u6_addr32[3] == addr->_IpAddr.sin6_addr.__in6_u.__u6_addr32[3])); + (this->_IpAddr.sin6_addr.s6_addr32[0] == addr->_IpAddr.sin6_addr.s6_addr32[0]) && \ + (this->_IpAddr.sin6_addr.s6_addr32[1] == addr->_IpAddr.sin6_addr.s6_addr32[1]) && \ + (this->_IpAddr.sin6_addr.s6_addr32[2] == addr->_IpAddr.sin6_addr.s6_addr32[2]) && \ + (this->_IpAddr.sin6_addr.s6_addr32[3] == addr->_IpAddr.sin6_addr.s6_addr32[3])); } SensorNetAddress& SensorNetAddress::operator =(SensorNetAddress& addr)