This commit is contained in:
keesbos 2015-06-26 20:16:58 +00:00
commit 288e78f063

View file

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