Skip to content

Commit

Permalink
fix for cwnd + do not use SYN for rtt calc
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Vincent committed Jan 27, 2015
1 parent eda0e5d commit 3ef1dab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/pico_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2028,12 +2028,12 @@ static int tcp_ack(struct pico_socket *s, struct pico_frame *f)
/* First, try with timestamps, using the value from options */
if(f && (f->timestamp != 0)) {
rtt = time_diff(TCP_TIME, f->timestamp);
if (rtt)
if (rtt && (hdr->flags & PICO_TCP_SYN == 0))
tcp_rtt(t, rtt);
} else if(acked_timestamp) {
/* If no timestamps are there, use conservatve estimation on the una */
rtt = time_diff(TCP_TIME, acked_timestamp);
if (rtt)
if (rtt && (hdr->flags & PICO_TCP_SYN == 0))
tcp_rtt(t, rtt);
}

Expand All @@ -2055,7 +2055,7 @@ static int tcp_ack(struct pico_socket *s, struct pico_frame *f)
tcp_dbg("Mode: DUPACK %d, due to PURE ACK %0x, len = %d\n", t->x_mode, SEQN(f), f->payload_len);
/* tcp_dbg("ACK: %x - QUEUE: %x\n", ACKN(f), SEQN(first_segment(&t->tcpq_out))); */
if (t->x_mode == PICO_TCP_RECOVER) { /* Switching mode */
t->cwnd = (uint16_t)t->in_flight;
//t->cwnd = (uint16_t)t->in_flight; // MVI: FIXME: need to reinit to default cwnd
t->snd_retry = SEQN((struct pico_frame *)first_segment(&t->tcpq_out));
if (t->ssthresh > t->cwnd)
t->ssthresh >>= 2;
Expand Down

0 comments on commit 3ef1dab

Please sign in to comment.