mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-22 22:33:58 -07:00
Set default accepted ethertypes if no rules are defined
This commit is contained in:
parent
221df51875
commit
8fa9248615
1 changed files with 9 additions and 0 deletions
|
@ -50,6 +50,7 @@
|
||||||
#include "../node/InetAddress.hpp"
|
#include "../node/InetAddress.hpp"
|
||||||
#include "../node/MAC.hpp"
|
#include "../node/MAC.hpp"
|
||||||
#include "../node/Address.hpp"
|
#include "../node/Address.hpp"
|
||||||
|
#include "../node/Switch.hpp"
|
||||||
#include "../osdep/OSUtils.hpp"
|
#include "../osdep/OSUtils.hpp"
|
||||||
|
|
||||||
// Include ZT_NETCONF_SCHEMA_SQL constant to init database
|
// Include ZT_NETCONF_SCHEMA_SQL constant to init database
|
||||||
|
@ -388,6 +389,14 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co
|
||||||
if ((et >= 0)&&(et <= 0xffff))
|
if ((et >= 0)&&(et <= 0xffff))
|
||||||
allowedEtherTypes.push_back(et);
|
allowedEtherTypes.push_back(et);
|
||||||
}
|
}
|
||||||
|
if (!allowedEtherTypes.size()) {
|
||||||
|
// Nothing permitted is not usefull
|
||||||
|
// Just supply a default config allowing ARP, IPv4, IPv6
|
||||||
|
// allowedEtherTypes.push_back(0); this would allow anything
|
||||||
|
allowedEtherTypes.push_back(ZT_ETHERTYPE_IPV4);
|
||||||
|
allowedEtherTypes.push_back(ZT_ETHERTYPE_ARP);
|
||||||
|
allowedEtherTypes.push_back(ZT_ETHERTYPE_IPV6);
|
||||||
|
}
|
||||||
std::sort(allowedEtherTypes.begin(),allowedEtherTypes.end());
|
std::sort(allowedEtherTypes.begin(),allowedEtherTypes.end());
|
||||||
std::unique(allowedEtherTypes.begin(),allowedEtherTypes.end());
|
std::unique(allowedEtherTypes.begin(),allowedEtherTypes.end());
|
||||||
std::string allowedEtherTypesCsv;
|
std::string allowedEtherTypesCsv;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue