aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2022-06-07 11:15:47 +0200
committerGitHub <noreply@github.com>2022-06-07 11:15:47 +0200
commitbb3c2e82de91860808ca79e43a3bbe09a1c39298 (patch)
treedc4417c018666fc01c9964aaf3b5c96bd1d08854 /src
parent938e89ca333db0d39f19c0f759f13a938f4b3014 (diff)
Dissect host line if SSDP contains such. (#1586)
Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_typedefs.h2
-rw-r--r--src/lib/protocols/ssdp.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 78e879a0d..2ffb35621 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -1191,7 +1191,7 @@ struct ndpi_flow_struct {
char flow_extra_info[16];
/* General purpose field used to save mainly hostname/SNI information.
- * In details it used for: DNS and NETBIOS name, HTTP and DHCP hostname,
+ * In details it used for: DNS, SSDP and NETBIOS name, HTTP and DHCP hostname,
* WHOIS request, TLS/QUIC server name, XIAOMI domain and STUN realm.
*
* Please, think *very* hard before increasing its size!
diff --git a/src/lib/protocols/ssdp.c b/src/lib/protocols/ssdp.c
index 9fb1d0eae..6fe96309a 100644
--- a/src/lib/protocols/ssdp.c
+++ b/src/lib/protocols/ssdp.c
@@ -37,12 +37,20 @@ static void ssdp_parse_lines(struct ndpi_detection_module_struct
ndpi_parse_packet_line_info(ndpi_struct, flow);
/* Save user-agent for device discovery if available */
- if(packet->user_agent_line.ptr != NULL && packet->user_agent_line.len != 0) {
+ if(packet->user_agent_line.ptr != NULL && packet->user_agent_line.len > 0) {
if (ndpi_user_agent_set(flow, packet->user_agent_line.ptr, packet->user_agent_line.len) == NULL)
{
NDPI_LOG_DBG2(ndpi_struct, "Could not set SSDP user agent\n");
}
}
+
+ /* Save host which provides a service if available */
+ if (packet->host_line.ptr != NULL && packet->host_line.len > 0) {
+ if (ndpi_hostname_sni_set(flow, packet->host_line.ptr, packet->host_line.len) == NULL)
+ {
+ NDPI_LOG_DBG2(ndpi_struct, "Could not set SSDP host\n");
+ }
+ }
}
static void ndpi_int_ssdp_add_connection(struct ndpi_detection_module_struct