diff options
author | Campus <campus@ntop.org> | 2016-03-14 01:04:50 +0100 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-03-14 01:04:50 +0100 |
commit | 4370781b4909a3f905996e94a7a1f8b66695dedd (patch) | |
tree | 408e32cdcf5b008c47114cab0492397d9b154abb /src/lib/protocols/tcp_udp.c | |
parent | 1cf4926b4e4f485ead5e36c0e57e2dc99da51414 (diff) |
rework API (part 1) - minor fixes functions
Diffstat (limited to 'src/lib/protocols/tcp_udp.c')
-rw-r--r-- | src/lib/protocols/tcp_udp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/protocols/tcp_udp.c b/src/lib/protocols/tcp_udp.c index 9f9febfeb..2c6792551 100644 --- a/src/lib/protocols/tcp_udp.c +++ b/src/lib/protocols/tcp_udp.c @@ -30,6 +30,7 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc u_int16_t sport, u_int16_t dport) /* host endianess */ { u_int16_t rc; + struct in_addr host; if(protocol == IPPROTO_UDP) { if((sport == dport) && (sport == 17500)) { @@ -37,9 +38,12 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc } } - if((rc = ndpi_host_ptree_match(ndpi_struct, htonl(saddr))) != NDPI_PROTOCOL_UNKNOWN) return(rc); - - return(ndpi_host_ptree_match(ndpi_struct, htonl(daddr))); + host.s_addr = htonl(saddr); + if((rc = ndpi_network_ptree_match(ndpi_struct, &host)) != NDPI_PROTOCOL_UNKNOWN) + return (rc); + + host.s_addr = htonl(daddr); + return (ndpi_network_ptree_match(ndpi_struct, &host)); } void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) |