diff options
author | Campus <campus@ntop.org> | 2016-10-03 14:36:51 +0200 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-10-03 14:36:51 +0200 |
commit | 7e8e243e68bc6bc4d979e03887d57d75fd36f00b (patch) | |
tree | f3aee961eccb4b6a7bfef71773eb390ae25605a2 /src/lib/protocols/stun.c | |
parent | cf470ec03825fcd4deb58b4c43b39595dd044125 (diff) |
fix check for issue https://github.com/ntop/nDPI/issues/272
Diffstat (limited to 'src/lib/protocols/stun.c')
-rw-r--r-- | src/lib/protocols/stun.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index 1b2bb9843..caebeb066 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -21,9 +21,8 @@ * along with nDPI. If not, see <http://www.gnu.org/licenses/>. * */ - - #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_STUN @@ -87,6 +86,7 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * */ while(offset < payload_length) { + u_int16_t attribute = ntohs(*((u_int16_t*)&payload[offset])); u_int16_t len = ntohs(*((u_int16_t*)&payload[offset+2])); @@ -120,13 +120,12 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * break; default: - /* This means this STUN packet cannot be confused with whatsapp voice */ - can_this_be_whatsapp_voice = 0; - break; + /* This means this STUN packet cannot be confused with whatsapp voice */ + can_this_be_whatsapp_voice = 0; + break; } offset += len + 4; } - goto udp_stun_found; } @@ -239,7 +238,7 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * udp_stun_found: if(can_this_be_whatsapp_voice) - flow->num_stun_udp_pkts++; + flow->num_stun_udp_pkts++; return((flow->num_stun_udp_pkts < MAX_NUM_STUN_PKTS) ? NDPI_IS_NOT_STUN : NDPI_IS_STUN); } |