mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-30 09:48:54 +00:00
Fix ICMP json.
This commit is contained in:
parent
8850a8610a
commit
2cb760e0ac
@ -222,10 +222,10 @@ static json _renderRule(ZT_VirtualNetworkRule &rule)
|
|||||||
break;
|
break;
|
||||||
case ZT_NETWORK_RULE_MATCH_ICMP:
|
case ZT_NETWORK_RULE_MATCH_ICMP:
|
||||||
r["type"] = "MATCH_ICMP";
|
r["type"] = "MATCH_ICMP";
|
||||||
r["type"] = (unsigned int)rule.v.icmp.type;
|
r["icmpType"] = (unsigned int)rule.v.icmp.type;
|
||||||
if ((rule.v.icmp.flags & 0x01) != 0)
|
if ((rule.v.icmp.flags & 0x01) != 0)
|
||||||
r["code"] = (unsigned int)rule.v.icmp.code;
|
r["icmpCode"] = (unsigned int)rule.v.icmp.code;
|
||||||
else r["code"] = json();
|
else r["icmpCode"] = json();
|
||||||
break;
|
break;
|
||||||
case ZT_NETWORK_RULE_MATCH_IP_SOURCE_PORT_RANGE:
|
case ZT_NETWORK_RULE_MATCH_IP_SOURCE_PORT_RANGE:
|
||||||
r["type"] = "MATCH_IP_SOURCE_PORT_RANGE";
|
r["type"] = "MATCH_IP_SOURCE_PORT_RANGE";
|
||||||
@ -401,8 +401,8 @@ static bool _parseRule(json &r,ZT_VirtualNetworkRule &rule)
|
|||||||
return true;
|
return true;
|
||||||
} else if (t == "MATCH_ICMP") {
|
} else if (t == "MATCH_ICMP") {
|
||||||
rule.t |= ZT_NETWORK_RULE_MATCH_ICMP;
|
rule.t |= ZT_NETWORK_RULE_MATCH_ICMP;
|
||||||
rule.v.icmp.type = (uint8_t)(_jI(r["type"],0ULL) & 0xffULL);
|
rule.v.icmp.type = (uint8_t)(_jI(r["icmpType"],0ULL) & 0xffULL);
|
||||||
json &code = r["code"];
|
json &code = r["icmpCode"];
|
||||||
if (code.is_null()) {
|
if (code.is_null()) {
|
||||||
rule.v.icmp.code = 0;
|
rule.v.icmp.code = 0;
|
||||||
rule.v.icmp.flags = 0x00;
|
rule.v.icmp.flags = 0x00;
|
||||||
|
Loading…
Reference in New Issue
Block a user