wifi-diag: Fix incorrect matching of seqno in TCP frames.

This commit is contained in:
Ben Greear
2019-03-05 16:36:26 -08:00
parent a047f4e68b
commit d09a88784c
2 changed files with 22 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ sub new {
acked_by => -1,
block_acked_by => -1,
retrans => 0,
seen_ip => 0,
timestamp => 0,
datarate => 0,
dummy_tx_pkts => 0,
@@ -76,6 +77,21 @@ sub append {
#print "ln: $ln\n";
if ($ln =~ /^\s*Internet Protocol Version/) {
$self->{seen_ip} = 1;
return;
}
if ($self->{seen_ip}) {
if ($ln =~ /^\s*A-MSDU Subframe/) {
$self->{seen_ip} = 0;
}
else {
# Ignore
return;
}
}
if ($ln =~ /^\s*Transmitter address: .*\((\S+)\)/) {
$self->{transmitter} = $1;
}

View File

@@ -195,6 +195,10 @@ while (<>) {
} else {
$cur_pkt->append($ln);
}
if ($pkts_sofar > 1500) {
last;
}
}
if ($cur_pkt->raw_pkt() ne "") {
@@ -627,7 +631,8 @@ sub processPkt {
if ($pkt->{is_last_ampdu}) {
$is_last_ampdu = 1;
$ampdu_chain_time = $pkt->timestamp() - $first_ampdu_pkt->timestamp();
print "First ampdu pkt: " . $first_ampdu_pkt->frame_num() . " last: " . $pkt->frame_num()
print "First ampdu pkt: " . $first_ampdu_pkt->frame_num() . " seqno: " . $first_ampdu_pkt->seqno()
. " last: " . $pkt->frame_num() . " seqno: " . $pkt->seqno()
. " chain-time: $ampdu_chain_time, chain-count: $this_ampdu_pkt_count.\n";
$first_ampdu_pkt->{seqno} = -1; # Initialize to invalid again.
}