diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-10-13 14:21:00 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-10-13 14:21:00 -0700 |
| commit | 4f3775bb866aa4b19024266cb3db1705f3c9f710 (patch) | |
| tree | 4cdefa96ca3cc2ffedd9c35bc7eac3661b187ce4 /node | |
| parent | 2cb760e0ace2693684e79f782f17b77bf47377bb (diff) | |
| download | infinitytier-4f3775bb866aa4b19024266cb3db1705f3c9f710.tar.gz infinitytier-4f3775bb866aa4b19024266cb3db1705f3c9f710.zip | |
Fix ICMP match.
Diffstat (limited to 'node')
| -rw-r--r-- | node/Network.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/node/Network.cpp b/node/Network.cpp index 8a30f5f8..4fd3bfc1 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -383,8 +383,8 @@ static _doZtFilterResult _doZtFilter( break; case ZT_NETWORK_RULE_MATCH_ICMP: if ((etherType == ZT_ETHERTYPE_IPV4)&&(frameLen >= 20)) { - if (frameData[9] == 0x01) { - const unsigned int ihl = (frameData[0] & 0xf) * 32; + if (frameData[9] == 0x01) { // IP protocol == ICMP + const unsigned int ihl = (frameData[0] & 0xf) * 4; if (frameLen >= (ihl + 2)) { if (rules[rn].v.icmp.type == frameData[ihl]) { if ((rules[rn].v.icmp.flags & 0x01) != 0) { |
