From 85bb227b4575c348658e5c5494b75d16887cb1d9 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:28:41 +0100 Subject: ndpi_main: fix unused variable 'node/ret' [-Wunused-variable] --- src/lib/ndpi_main.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index d1f522e84..6ec3546e2 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -1927,8 +1927,6 @@ static ndpi_default_ports_tree_node_t* ndpi_get_guessed_protocol_id(struct ndpi_ u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_struct, u_int8_t proto, u_int16_t sport, u_int16_t dport, u_int8_t *user_defined_proto) { - const void *ret; - ndpi_default_ports_tree_node_t node; *user_defined_proto = 0; /* Default */ if(sport && dport) { -- cgit v1.2.3 From 141bb48d76af38e841765f4a20563ed5065e59e4 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:30:10 +0100 Subject: BGP: fix unused function 'ndpi_int_bgp_add_connection' [-Wunused-function] --- src/lib/protocols/bgp.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/lib/protocols/bgp.c b/src/lib/protocols/bgp.c index 0ec6fa59c..a45514b7d 100644 --- a/src/lib/protocols/bgp.c +++ b/src/lib/protocols/bgp.c @@ -24,12 +24,6 @@ #ifdef NDPI_PROTOCOL_BGP - -static void ndpi_int_bgp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) -{ - ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN); -} - /* this detection also works asymmetrically */ void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { -- cgit v1.2.3 From 1082a234fe86e604f3a1cd7cbdb36f9cbfe1e107 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:31:05 +0100 Subject: bittorrent: fix unused variable 'no_bittorrent' [-Wunused-variable] --- src/lib/protocols/bittorrent.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 0eebe07ee..084f80be7 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -385,7 +385,6 @@ static void ndpi_int_search_bittorrent_tcp(struct ndpi_detection_module_struct * void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; - int no_bittorrent = 0; char *bt_proto = NULL; /* This is broadcast */ -- cgit v1.2.3 From 2a2a0d4aeb6d87c4989bee87d0de5542b28b609d Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:31:59 +0100 Subject: git: fix unused variable 'git_len' [-Wunused-variable] --- src/lib/protocols/git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/git.c b/src/lib/protocols/git.c index e156b7913..a60a94fe1 100644 --- a/src/lib/protocols/git.c +++ b/src/lib/protocols/git.c @@ -35,7 +35,7 @@ void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct, const u_int8_t * pp = packet->payload; u_int16_t payload_len = packet->payload_packet_len; u_int8_t found_git = 1; - u_int16_t git_len = 0, offset = 0; + u_int16_t offset = 0; while((offset+4) < payload_len) { char len[5]; -- cgit v1.2.3 From 57ad066e662f18da18c3690e833ae9c32e727904 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:33:35 +0100 Subject: QUIC: fix unused variable 'begin' [-Wunused-variable] --- src/lib/protocols/quic.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 8050a9b61..35b8d0911 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -73,7 +73,6 @@ void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, && ((packet->payload[0] & 0xC2) == 0x00) && (quic_ports(ntohs(packet->udp->source), ntohs(packet->udp->dest))) ) { - char *begin; int i; if((version_len > 0) && (packet->payload[1+cid_len] != 'Q')) -- cgit v1.2.3 From 65f61fd5b1ff03951a2adfa12e4e34ab726b0f12 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:35:36 +0100 Subject: rx: fix unused variable 'found' [-Wunused-variable] --- src/lib/protocols/rx.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/lib/protocols/rx.c b/src/lib/protocols/rx.c index 9d27d5e18..e5ae25476 100644 --- a/src/lib/protocols/rx.c +++ b/src/lib/protocols/rx.c @@ -78,8 +78,6 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct, { struct ndpi_packet_struct *packet = &flow->packet; u_int32_t payload_len = packet->payload_packet_len; - int found = 0; - NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "RX: pck: %d, dir[0]: %d, dir[1]: %d\n", flow->packet_counter, flow->packet_direction_counter[0], flow->packet_direction_counter[1]); -- cgit v1.2.3 From 26aec8714e62a930bb2f288e30fc53a512713b26 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 17:43:12 +0100 Subject: ndpi_main: fix enumeration value 'NDPI_PROTOCOL_CATEGORY_UNSPECIFIED' not handled in switch [-Wswitch] --- src/lib/ndpi_main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 6ec3546e2..b58b43c36 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4465,6 +4465,9 @@ const char* ndpi_category_str(ndpi_protocol_category_t category) { case NDPI_PROTOCOL_CATEGORY_SYSTEM: return("System"); break; + case NDPI_PROTOCOL_CATEGORY_UNSPECIFIED: + return("Unspecified"); + break; } return("Unspecified"); -- cgit v1.2.3 From 612a07f4204885458afb3192482f964344efd736 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 18:06:55 +0100 Subject: ndpi_main: fix variable 'daddr/saddr' set but not used [-Wunused-but-set-variable] --- src/lib/ndpi_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index b58b43c36..50a234b2f 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -3487,14 +3487,13 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct flow->packet.iph)) { u_int16_t sport, dport; u_int8_t protocol; - u_int32_t saddr, daddr; u_int8_t user_defined_proto; flow->protocol_id_already_guessed = 1; #ifdef NDPI_DETECTION_SUPPORT_IPV6 if(flow->packet.iphv6 != NULL) { - protocol = flow->packet.iphv6->ip6_ctlun.ip6_un1.ip6_un1_nxt, saddr = 0, daddr = 0; + protocol = flow->packet.iphv6->ip6_ctlun.ip6_un1.ip6_un1_nxt; } else #endif { -- cgit v1.2.3 From 45bcb9927deaa4cdea2f2ac9a4d73aefba7c486b Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sun, 13 Nov 2016 18:16:41 +0100 Subject: bittorrent: fix variable ‘peer_id’ set but not used [-Werror=unused-but-set-variable] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/protocols/bittorrent.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 084f80be7..a88b1cce5 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -57,16 +57,15 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc { if(check_hash) { const char *bt_hash = NULL; /* 20 bytes long */ - const char *peer_id = NULL; /* 20 bytes long */ if(bt_offset == -1) { const char *bt_magic = ndpi_strnstr((const char *)flow->packet.payload, "BitTorrent protocol", flow->packet.payload_packet_len); if(bt_magic) - bt_hash = &bt_magic[19], peer_id = &bt_magic[39]; + bt_hash = &bt_magic[19]; } else - bt_hash = (const char*)&flow->packet.payload[28], peer_id = (const char*)&flow->packet.payload[48]; + bt_hash = (const char*)&flow->packet.payload[28]; if(bt_hash) memcpy(flow->bittorent_hash, bt_hash, 20); } -- cgit v1.2.3