aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tcp_rxq.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libtle_l4p/tcp_rxq.h')
-rw-r--r--lib/libtle_l4p/tcp_rxq.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libtle_l4p/tcp_rxq.h b/lib/libtle_l4p/tcp_rxq.h
index 01f34fa..2351ee6 100644
--- a/lib/libtle_l4p/tcp_rxq.h
+++ b/lib/libtle_l4p/tcp_rxq.h
@@ -46,14 +46,16 @@ rx_ofo_enqueue(struct tle_tcp_stream *s, union seqlen *sl,
static inline uint32_t
rx_ofo_reduce(struct tle_tcp_stream *s)
{
- uint32_t i, n, end, seq;
+ uint32_t i, n, seq;
struct ofo *ofo;
struct ofodb *db;
- union seqlen sl;
seq = s->tcb.rcv.nxt;
ofo = s->rx.ofo;
+ if (ofo->nb_elem == 0)
+ return 0;
+
n = 0;
for (i = 0; i != ofo->nb_elem; i++) {
@@ -63,15 +65,11 @@ rx_ofo_reduce(struct tle_tcp_stream *s)
if (tcp_seq_lt(seq, db->sl.seq))
break;
- end = db->sl.seq + db->sl.len;
-
/* this db is fully overlapped */
- if (tcp_seq_leq(end, seq))
+ if (tcp_seq_leq(db->sl.seq + db->sl.len, seq))
_ofodb_free(db);
else
- n += _ofodb_enqueue(s->rx.q, db, &sl);
-
- seq = sl.seq + sl.len;
+ n += _ofodb_enqueue(s->rx.q, db, &seq);
}
s->tcb.rcv.nxt = seq;