diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-28 16:01:27 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-08-28 16:01:27 -0400 |
| commit | 55616388eaa5c43b4316882a5c4ab2e0c132b62e (patch) | |
| tree | 6e02779f8864c636e6d35609a984d884ae7741b3 /node/Switch.cpp | |
| parent | 8e1b897f0ae8a228799058153e9dda0a18aeb4c1 (diff) | |
| download | infinitytier-55616388eaa5c43b4316882a5c4ab2e0c132b62e.tar.gz infinitytier-55616388eaa5c43b4316882a5c4ab2e0c132b62e.zip | |
Check network ethernet type whitelist instead of hard-coded ethernet types.
Diffstat (limited to 'node/Switch.cpp')
| -rw-r--r-- | node/Switch.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index 9370522e..157ecec8 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -85,13 +85,14 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c LOG("ignored tap: %s -> %s %s (bridging is not (yet?) supported)",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType)); return; } + if (to == network->tap().mac()) { - LOG("%s: frame received from self, ignoring (bridge loop?)",network->tap().deviceName().c_str()); + LOG("%s: frame received from self, ignoring (bridge loop? OS bug?)",network->tap().deviceName().c_str()); return; } - if ((etherType != ZT_ETHERTYPE_ARP)&&(etherType != ZT_ETHERTYPE_IPV4)&&(etherType != ZT_ETHERTYPE_IPV6)) { - LOG("ignored tap: %s -> %s %s (not a supported etherType)",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType)); + if (!network->permitsEtherType(etherType)) { + LOG("ignored tap: %s -> %s: ethernet type %s not allowed on network %.16llx",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType),(unsigned long long)network->id()); return; } |
