STUN: improve extraction of Mapped-Address metadata (#2370)
Enable parsing of Mapped-Address attribute for all STUN flows: that means that STUN classification might require more packets. Add a configuration knob to enable/disable this feature. Note that we can have (any) STUN metadata also for flows *not* classified as STUN (because of DTLS). Add support for ipv6. Restore the correct extra dissection logic for Telegram flows.
This commit is contained in:
@@ -1309,9 +1309,12 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
ndpi_inc_bin(&flow->payload_len_bin, plen2slot(len), 1);
|
||||
}
|
||||
}
|
||||
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_STUN)) {
|
||||
flow->stun.mapped_address.ipv4 = flow->ndpi_flow->stun.mapped_address.ipv4,
|
||||
flow->stun.mapped_address.port = flow->ndpi_flow->stun.mapped_address.port;
|
||||
}
|
||||
|
||||
if(flow->ndpi_flow->stun.mapped_address.port) {
|
||||
memcpy(&flow->stun.mapped_address.address, &flow->ndpi_flow->stun.mapped_address.address, 16);
|
||||
flow->stun.mapped_address.port = flow->ndpi_flow->stun.mapped_address.port;
|
||||
flow->stun.mapped_address.is_ipv6 = flow->ndpi_flow->stun.mapped_address.is_ipv6;
|
||||
}
|
||||
|
||||
flow->multimedia_flow_type = flow->ndpi_flow->flow_multimedia_type;
|
||||
|
||||
Reference in New Issue
Block a user