aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2021-02-03 11:54:11 +0100
committerGitHub <noreply@github.com>2021-02-03 11:54:11 +0100
commit8c0ea694f86b184c0d09c7e76aa760336dfe0b62 (patch)
treee9963c26b32c9ef887d89a55ff219e57577858e5 /src/lib/protocols/http.c
parent8cee718e8b3a64ac9b66f88844f43f0594c1bb37 (diff)
HTTP: fix user-agent parsing (#1124)
User-agent information is used to try to detect the user OS; since the UA is extracted for QUIC traffic too, the "detected_os" field must be generic and not associated to HTTP flows only. Otherwise, you might overwrite some "tls_quic_stun" fields (SNI...) with random data. Strangely enough, the "detected_os" field is never used: it is never logged, or printed, or exported...
Diffstat (limited to 'src/lib/protocols/http.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index eec2a7bf1..07b777863 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -336,8 +336,8 @@ static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
/* Good reference for future implementations:
* https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */
- snprintf((char*)flow->protos.http.detected_os,
- sizeof(flow->protos.http.detected_os), "%s", ua);
+ snprintf((char*)flow->http.detected_os,
+ sizeof(flow->http.detected_os), "%s", ua);
}
/* ************************************************************* */