mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
fix L2TP delay stats
This commit is contained in:
@@ -857,6 +857,9 @@ bbl_l2tp_data_rx(bbl_ethernet_header_t *eth, bbl_l2tp_t *l2tp, bbl_interface_s *
|
||||
bbl_stream *stream;
|
||||
void **search = NULL;
|
||||
|
||||
struct timespec delay;
|
||||
uint64_t delay_nsec;
|
||||
|
||||
UNUSED(ctx);
|
||||
UNUSED(eth);
|
||||
|
||||
@@ -976,6 +979,18 @@ bbl_l2tp_data_rx(bbl_ethernet_header_t *eth, bbl_l2tp_t *l2tp, bbl_interface_s *
|
||||
stream->packets_rx++;
|
||||
stream->rx_len = eth->length;
|
||||
stream->rx_priority = ((bbl_ipv4_t*)eth->next)->tos;
|
||||
timespec_sub(&delay, ð->timestamp, &bbl->timestamp);
|
||||
delay_nsec = delay.tv_sec * 1e9 + delay.tv_nsec;
|
||||
if(delay_nsec > stream->max_delay_ns) {
|
||||
stream->max_delay_ns = delay_nsec;
|
||||
}
|
||||
if(stream->min_delay_ns) {
|
||||
if(delay_nsec < stream->min_delay_ns) {
|
||||
stream->min_delay_ns = delay_nsec;
|
||||
}
|
||||
} else {
|
||||
stream->min_delay_ns = delay_nsec;
|
||||
}
|
||||
if(!stream->rx_first_seq) {
|
||||
stream->rx_first_seq = bbl->flow_seq;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user