summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--node/Address.hpp12
-rw-r--r--node/MAC.hpp3
-rw-r--r--node/PacketDecoder.cpp2
3 files changed, 10 insertions, 7 deletions
diff --git a/node/Address.hpp b/node/Address.hpp
index 71c85f01..b28284b0 100644
--- a/node/Address.hpp
+++ b/node/Address.hpp
@@ -188,12 +188,12 @@ public:
inline bool wouldHaveMac(const MAC &mac) const
throw()
{
- return ((mac.data[0] != ZT_MAC_FIRST_OCTET)||
- (mac.data[1] != (unsigned char)((_a >> 32) & 0xff))||
- (mac.data[2] != (unsigned char)((_a >> 24) & 0xff))||
- (mac.data[3] != (unsigned char)((_a >> 16) & 0xff))||
- (mac.data[4] != (unsigned char)((_a >> 8) & 0xff))||
- (mac.data[5] != (unsigned char)(_a & 0xff)));
+ return ((mac.data[0] == ZT_MAC_FIRST_OCTET)&&
+ (mac.data[1] == (unsigned char)((_a >> 32) & 0xff))&&
+ (mac.data[2] == (unsigned char)((_a >> 24) & 0xff))&&
+ (mac.data[3] == (unsigned char)((_a >> 16) & 0xff))&&
+ (mac.data[4] == (unsigned char)((_a >> 8) & 0xff))&&
+ (mac.data[5] == (unsigned char)(_a & 0xff)));
}
/**
diff --git a/node/MAC.hpp b/node/MAC.hpp
index b1864511..87363a44 100644
--- a/node/MAC.hpp
+++ b/node/MAC.hpp
@@ -140,6 +140,9 @@ public:
Utils::unhex(s,data,6);
}
+ /**
+ * @return MAC address in standard :-delimited hex format
+ */
inline std::string toString() const
{
char tmp[32];
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index c23fab1d..2efa7cf9 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -535,7 +535,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
_r->identity.address().toString().c_str());
_r->demarc->send(Demarc::ANY_PORT,ZT_DEFAULTS.multicastTraceWatcher,mct,strlen(mct),-1);
#endif
- TRACE("dropped MULTICAST_FRAME from %s(%s) into %.16llx: source mac %s doesn't belong to %s, and bridging is not supported on network",source().toString().c_str(),nwid,_remoteAddress.toString().c_str(),sourceMac.toString().c_str(),origin.toString().c_str());
+ TRACE("dropped MULTICAST_FRAME from %s(%s) into %.16llx: source mac %s doesn't belong to %s, and bridging is not supported on network",source().toString().c_str(),_remoteAddress.toString().c_str(),nwid,sourceMac.toString().c_str(),origin.toString().c_str());
return true;
} else if (!nconf->permitsEtherType(etherType)) {
// Ditto for this-- halt propagation if this is for an ethertype