Bladeren bron

Bug fixes: inverted sense bug, printf format bug.

Adam Ierymenko 11 jaren geleden
bovenliggende
commit
fbf6ab5d4d
3 gewijzigde bestanden met toevoegingen van 10 en 7 verwijderingen
  1. 6 6
      node/Address.hpp
  2. 3 0
      node/MAC.hpp
  3. 1 1
      node/PacketDecoder.cpp

+ 6 - 6
node/Address.hpp

@@ -188,12 +188,12 @@ public:
 	inline bool wouldHaveMac(const MAC &mac) const
 	inline bool wouldHaveMac(const MAC &mac) const
 		throw()
 		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)));
 	}
 	}
 
 
 	/**
 	/**

+ 3 - 0
node/MAC.hpp

@@ -140,6 +140,9 @@ public:
 		Utils::unhex(s,data,6);
 		Utils::unhex(s,data,6);
 	}
 	}
 
 
+	/**
+	 * @return MAC address in standard :-delimited hex format
+	 */
 	inline std::string toString() const
 	inline std::string toString() const
 	{
 	{
 		char tmp[32];
 		char tmp[32];

+ 1 - 1
node/PacketDecoder.cpp

@@ -535,7 +535,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
 							_r->identity.address().toString().c_str());
 							_r->identity.address().toString().c_str());
 						_r->demarc->send(Demarc::ANY_PORT,ZT_DEFAULTS.multicastTraceWatcher,mct,strlen(mct),-1);
 						_r->demarc->send(Demarc::ANY_PORT,ZT_DEFAULTS.multicastTraceWatcher,mct,strlen(mct),-1);
 #endif
 #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;
 						return true;
 					} else if (!nconf->permitsEtherType(etherType)) {
 					} else if (!nconf->permitsEtherType(etherType)) {
 						// Ditto for this-- halt propagation if this is for an ethertype
 						// Ditto for this-- halt propagation if this is for an ethertype