Bug fixes: inverted sense bug, printf format bug.

This commit is contained in:
Adam Ierymenko 2013-10-18 16:27:07 -04:00
parent e13d4df9ab
commit fbf6ab5d4d
3 changed files with 10 additions and 7 deletions

View File

@ -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)));
}
/**

View File

@ -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];

View File

@ -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