aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tcp_misc.h
diff options
context:
space:
mode:
authorJielong Zhou <jielong.zjl@antfin.com>2019-07-02 20:21:01 +0800
committerJielong Zhou <jielong.zjl@antfin.com>2019-08-13 12:19:01 +0800
commit17f6b7ad23f52784f0a6897480d7a6050806aa65 (patch)
tree363b2d37642ec9ff9473c47afd80775d6341e516 /lib/libtle_l4p/tcp_misc.h
parent3fbc22a6729f577e03a5be527671a3d7ac11ef25 (diff)
l4p/tcp_ofo: fix handling out-of-order packets
Problems are: 1. ofodb could not be assigned directly, as direct assignment does not copy the mbuf pointer area belonging to it. 2. _ofo_insert_new and _ofo_insert_right doesn't remove overlap correctly. 3. _ofo_insert_new insert new db in wrong position. 4. rx_ofo_reduce sets wrong seq, and would insert overlapped data into rx queue. 5. _ofo_compact may miss compacting some ofodbs and doesn't update partly moved ofodb correctly. Change-Id: I03f1065ef5a15ef2abc664f9cc98910aab72d39b Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>
Diffstat (limited to 'lib/libtle_l4p/tcp_misc.h')
-rw-r--r--lib/libtle_l4p/tcp_misc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libtle_l4p/tcp_misc.h b/lib/libtle_l4p/tcp_misc.h
index 1b15dc5..0cef8b2 100644
--- a/lib/libtle_l4p/tcp_misc.h
+++ b/lib/libtle_l4p/tcp_misc.h
@@ -246,6 +246,14 @@ tcp_seq_leq(uint32_t l, uint32_t r)
return (int32_t)(l - r) <= 0;
}
+static inline uint32_t
+tcp_seq_min(uint32_t l, uint32_t r)
+{
+ if (tcp_seq_lt(l, r))
+ return l;
+ else
+ return r;
+}
static inline void
get_seg_info(const struct tcp_hdr *th, union seg_info *si)