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...
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/* ************************************************************* */
|
||||
|
||||
Reference in New Issue
Block a user