aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ndpi_content_match.c.inc7
-rw-r--r--src/lib/ndpi_main.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc
index 3b4693fc3..1a7f8eef6 100644
--- a/src/lib/ndpi_content_match.c.inc
+++ b/src/lib/ndpi_content_match.c.inc
@@ -72,12 +72,14 @@ static ndpi_network host_protocol_list[] = {
{ 0x6CA0A000 /* 108.160.160.0 */, 20, NDPI_PROTOCOL_DROPBOX },
/*
- Skype
+ Skype (Microsoft CDN)
157.56.0.0/14, 157.60.0.0/16, 157.54.0.0/15
+ 111.221.64.0 - 111.221.127.255
*/
{ 0x9D380000 /* 157.56.0.0 */, 14, NDPI_PROTOCOL_SKYPE },
{ 0x9D3C0000 /* 157.60.0.0 */, 16, NDPI_PROTOCOL_SKYPE },
- { 0x9D360000 /* 157.54.0.0/ */, 15, NDPI_PROTOCOL_SKYPE },
+ { 0x9D360000 /* 157.54.0.0 */, 15, NDPI_PROTOCOL_SKYPE },
+ { 0x6FDD4000 /* 111.221.64.0 */, 18, NDPI_PROTOCOL_SKYPE },
/*
Google
@@ -258,6 +260,7 @@ static ndpi_network host_protocol_list[] = {
{ 0xD820F200, 24, NDPI_PROTOCOL_SKYPE },
{ 0xD821F000, 22, NDPI_PROTOCOL_SKYPE },
{ 0xD4A10800, 24, NDPI_PROTOCOL_SKYPE },
+
{ 0x012A1231, 32, NDPI_PROTOCOL_TOR },
{ 0x01E69FA1, 32, NDPI_PROTOCOL_TOR },
{ 0x020DE985, 32, NDPI_PROTOCOL_TOR },
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 7719f766e..8d39d8115 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1677,6 +1677,7 @@ static int fill_prefix_v4(prefix_t *p, struct in_addr *a, int b, int mb) {
if(b < 0 || b > mb)
return(-1);
+ memset(p, 0, sizeof(prefix_t));
memcpy(&p->add.sin, a, (mb+7)/8);
p->family = AF_INET;
p->bitlen = b;
@@ -1692,6 +1693,7 @@ u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_str
prefix_t prefix;
patricia_node_t *node;
+ pin->s_addr = ntohl(pin->s_addr); /* Make sure all in network byte order otherwise compares wont work */
fill_prefix_v4(&prefix, pin, 32, ((patricia_tree_t*)ndpi_struct->protocols_ptree)->maxbits);
node = ndpi_patricia_search_best(ndpi_struct->protocols_ptree, &prefix);
@@ -1755,7 +1757,7 @@ static void ndpi_init_ptree_ipv4(struct ndpi_detection_module_struct *ndpi_str,
struct in_addr pin;
patricia_node_t *node;
- pin.s_addr = host_list[i].network;
+ pin.s_addr = ntohl(host_list[i].network);
if((node = add_to_ptree(ptree, AF_INET, &pin, host_list[i].cidr /* bits */)) != NULL)
node->value.user_value = host_list[i].value;
}