diff --git a/node/Membership.hpp b/node/Membership.hpp index 506573ed2..73e11c6c1 100644 --- a/node/Membership.hpp +++ b/node/Membership.hpp @@ -136,7 +136,7 @@ public: if (_isCredentialTimestampValid(nconf,*v)&&(v->owns(r))) return true; } - return false; + return _isV6NDPEmulated(nconf,r); } /** @@ -191,6 +191,15 @@ public: static uint64_t credentialKey(const Credential::Type &t,const uint32_t i) { return (((uint64_t)t << 32) | (uint64_t)i); } private: + inline bool _isV6NDPEmulated(const NetworkConfig &nconf,const MAC &m) const { return false; } + inline bool _isV6NDPEmulated(const NetworkConfig &nconf,const InetAddress &ip) const + { + if ((ip.isV6())&&(nconf.ndpEmulation())&&((InetAddress::makeIpv66plane(nconf.networkId,nconf.issuedTo.toInt()).ipsEqual(ip))||(InetAddress::makeIpv6rfc4193(nconf.networkId,nconf.issuedTo.toInt()).ipsEqual(ip)))) { + return true; + } + return false; + } + template inline bool _isCredentialTimestampValid(const NetworkConfig &nconf,const C &remoteCredential) const {