From 4fe44aa5ae2e9869b6dd1cca13667809047b5517 Mon Sep 17 00:00:00 2001 From: lns Date: Mon, 6 Jun 2022 18:50:35 +0200 Subject: Dissect host line if SSDP contains such. Signed-off-by: lns --- src/lib/protocols/ssdp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/lib/protocols/ssdp.c') 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 -- cgit v1.2.3