diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-10-13 14:14:46 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-10-13 14:14:46 -0700 |
commit | 2cb760e0ace2693684e79f782f17b77bf47377bb (patch) | |
tree | aea531e69e8030528c6e92be6009a73bd75c75c9 | |
parent | 8850a8610abe1dabd2c035e2e57ccbe1a4aff392 (diff) | |
download | infinitytier-2cb760e0ace2693684e79f782f17b77bf47377bb.tar.gz infinitytier-2cb760e0ace2693684e79f782f17b77bf47377bb.zip |
Fix ICMP json.
-rw-r--r-- | controller/EmbeddedNetworkController.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 2c43d4b5..d9ec76de 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -222,10 +222,10 @@ static json _renderRule(ZT_VirtualNetworkRule &rule) break; case ZT_NETWORK_RULE_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) - r["code"] = (unsigned int)rule.v.icmp.code; - else r["code"] = json(); + r["icmpCode"] = (unsigned int)rule.v.icmp.code; + else r["icmpCode"] = json(); break; case ZT_NETWORK_RULE_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; } else if (t == "MATCH_ICMP") { rule.t |= ZT_NETWORK_RULE_MATCH_ICMP; - rule.v.icmp.type = (uint8_t)(_jI(r["type"],0ULL) & 0xffULL); - json &code = r["code"]; + rule.v.icmp.type = (uint8_t)(_jI(r["icmpType"],0ULL) & 0xffULL); + json &code = r["icmpCode"]; if (code.is_null()) { rule.v.icmp.code = 0; rule.v.icmp.flags = 0x00; |