Fix how MAC addresses are handled by the rules parser
It wasn't ignoring separator characters such as the colon and hyphen. The rules compiler automatically add a colon to separate bytes, which is not compatible with how they are parsed.
This commit is contained in:
parent
a477688e51
commit
1aa31e0414
2 changed files with 16 additions and 2 deletions
|
@ -315,12 +315,12 @@ static bool _parseRule(json &r,ZT_VirtualNetworkRule &rule)
|
|||
return true;
|
||||
} else if (t == "MATCH_MAC_SOURCE") {
|
||||
rule.t |= ZT_NETWORK_RULE_MATCH_MAC_SOURCE;
|
||||
const std::string mac(OSUtils::jsonString(r["mac"],"0"));
|
||||
const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0")));
|
||||
Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6);
|
||||
return true;
|
||||
} else if (t == "MATCH_MAC_DEST") {
|
||||
rule.t |= ZT_NETWORK_RULE_MATCH_MAC_DEST;
|
||||
const std::string mac(OSUtils::jsonString(r["mac"],"0"));
|
||||
const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0")));
|
||||
Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6);
|
||||
return true;
|
||||
} else if (t == "MATCH_IPV4_SOURCE") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue