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:
@@ -1239,6 +1239,7 @@ struct ndpi_flow_struct {
|
||||
u_int8_t num_request_headers, num_response_headers;
|
||||
u_int8_t request_version; /* 0=1.0 and 1=1.1. Create an enum for this? */
|
||||
u_int16_t response_status_code; /* 200, 404, etc. */
|
||||
u_char detected_os[32]; /* Via HTTP/QUIC User-Agent */
|
||||
} http;
|
||||
|
||||
/*
|
||||
@@ -1316,8 +1317,6 @@ struct ndpi_flow_struct {
|
||||
} ubntac2;
|
||||
|
||||
struct {
|
||||
/* Via HTTP User-Agent */
|
||||
u_char detected_os[32];
|
||||
/* Via HTTP X-Forwarded-For */
|
||||
u_char nat_ip[24];
|
||||
} http;
|
||||
|
||||
Reference in New Issue
Block a user