diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-07-22 12:10:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 12:10:43 +0200 |
commit | ce6f11840d1ae7a9f1e1537d004c4814842fa305 (patch) | |
tree | 3c718920cf745ab97e276ea13d26ffc475ac323b /src/lib | |
parent | e85d6d7db79b560b2d9f9759b632c02e4188d8af (diff) |
Bittorrent: fix keys in cache code (#1670)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/protocols/bittorrent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 36936b8a0..d2cfa93f5 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -142,9 +142,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_ip_port_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+i)); else - key1 = ndpi_ip_port_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+i)); ndpi_lru_add_to_cache(ndpi_struct->bittorrent_cache, key1, NDPI_PROTOCOL_BITTORRENT); } |