diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-07 09:33:39 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-02-07 09:33:39 -0800 |
| commit | 672f17c6e9ae981a70c51fdd62882e4847c5b6ba (patch) | |
| tree | 176f8ec5a5864c490c1d6ad009af6e79cdcf326f /node/Capability.hpp | |
| parent | 723a9a6e9aa4254c7d740f9af6596ba8450924ac (diff) | |
| download | infinitytier-672f17c6e9ae981a70c51fdd62882e4847c5b6ba.tar.gz infinitytier-672f17c6e9ae981a70c51fdd62882e4847c5b6ba.zip | |
Add a mask and value range to the IP tos rule field. This allows TOS to be matched more usefully. This will break anyone using tos in the beta, but nobody seems to be and its pre-release so now is the time.
Diffstat (limited to 'node/Capability.hpp')
| -rw-r--r-- | node/Capability.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/node/Capability.hpp b/node/Capability.hpp index ddbfd9ee..08714038 100644 --- a/node/Capability.hpp +++ b/node/Capability.hpp @@ -216,8 +216,10 @@ public: b.append((uint8_t)rules[i].v.ipv6.mask); break; case ZT_NETWORK_RULE_MATCH_IP_TOS: - b.append((uint8_t)1); - b.append((uint8_t)rules[i].v.ipTos); + b.append((uint8_t)3); + b.append((uint8_t)rules[i].v.ipTos.mask); + b.append((uint8_t)rules[i].v.ipTos.value[0]); + b.append((uint8_t)rules[i].v.ipTos.value[1]); break; case ZT_NETWORK_RULE_MATCH_IP_PROTOCOL: b.append((uint8_t)1); @@ -308,7 +310,9 @@ public: rules[ruleCount].v.ipv6.mask = (uint8_t)b[p + 16]; break; case ZT_NETWORK_RULE_MATCH_IP_TOS: - rules[ruleCount].v.ipTos = (uint8_t)b[p]; + rules[ruleCount].v.ipTos.mask = (uint8_t)b[p]; + rules[ruleCount].v.ipTos.value[0] = (uint8_t)b[p+1]; + rules[ruleCount].v.ipTos.value[1] = (uint8_t)b[p+2]; break; case ZT_NETWORK_RULE_MATCH_IP_PROTOCOL: rules[ruleCount].v.ipProtocol = (uint8_t)b[p]; |
