diff options
author | Luca Deri <deri@ntop.org> | 2022-01-23 20:59:36 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2022-01-23 20:59:36 +0100 |
commit | b6b4967aa603035af066a4a7a3b5155573a5112f (patch) | |
tree | 747127ae97022fd6f42b6e758bec131341e27dba /src/lib/protocols/bittorrent.c | |
parent | a8fe74e502461cf6d6d1dee3567a3c39445d301e (diff) |
Improved Zoom protocol detection
Diffstat (limited to 'src/lib/protocols/bittorrent.c')
-rw-r--r-- | src/lib/protocols/bittorrent.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index fae1f6f46..a88fe7ad9 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -134,9 +134,9 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc u_int32_t key1, key2, i; if(packet->udp) - key1 = ndpi_bittorrent_hash_funct(packet->iph->saddr, packet->udp->source), key2 = ndpi_bittorrent_hash_funct(packet->iph->daddr, packet->udp->dest); + key1 = ndpi_ip_port_hash_funct(packet->iph->saddr, packet->udp->source), key2 = ndpi_ip_port_hash_funct(packet->iph->daddr, packet->udp->dest); else - key1 = ndpi_bittorrent_hash_funct(packet->iph->saddr, packet->tcp->source), key2 = ndpi_bittorrent_hash_funct(packet->iph->daddr, packet->tcp->dest); + key1 = ndpi_ip_port_hash_funct(packet->iph->saddr, packet->tcp->source), key2 = ndpi_ip_port_hash_funct(packet->iph->daddr, packet->tcp->dest); ndpi_lru_add_to_cache(ndpi_struct->bittorrent_cache, key1, NDPI_PROTOCOL_BITTORRENT); ndpi_lru_add_to_cache(ndpi_struct->bittorrent_cache, key2, NDPI_PROTOCOL_BITTORRENT); @@ -149,9 +149,9 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc /* Also add +2 ports of the sender in order to catch additional sockets open by the same client */ for(i=0; i<2; i++) { if(packet->udp) - key1 = ndpi_bittorrent_hash_funct(packet->iph->saddr, htons(ntohs(packet->udp->source)+1)); + key1 = ndpi_ip_port_hash_funct(packet->iph->saddr, htons(ntohs(packet->udp->source)+1)); else - key1 = ndpi_bittorrent_hash_funct(packet->iph->saddr, htons(ntohs(packet->tcp->source)+1)); + key1 = ndpi_ip_port_hash_funct(packet->iph->saddr, htons(ntohs(packet->tcp->source)+1)); ndpi_lru_add_to_cache(ndpi_struct->bittorrent_cache, key1, NDPI_PROTOCOL_BITTORRENT); } |