diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-05-14 10:43:49 +0000 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2021-06-03 14:21:58 +0000 |
commit | 76592f906ad040f5d99203c94719366ef42d2167 (patch) | |
tree | 5743c700d0e1713934379c566cfe88b4db001d45 /lib/libtle_l4p/syncookie.h | |
parent | f91fc4629e95f861ddc520225c815167d117e22e (diff) |
This reverts commit e0d62f616439955946d24ad83d49552da24afd5d.
Reason for revert: wrong branch
Change-Id: I1b4fef19dc130de4538f319b2e417bfc8ab1a1c9
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'lib/libtle_l4p/syncookie.h')
-rw-r--r-- | lib/libtle_l4p/syncookie.h | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/lib/libtle_l4p/syncookie.h b/lib/libtle_l4p/syncookie.h index 6d4372d..61bfce4 100644 --- a/lib/libtle_l4p/syncookie.h +++ b/lib/libtle_l4p/syncookie.h @@ -178,52 +178,41 @@ sync_check_ack(const union pkt_info *pi, uint32_t seq, uint32_t ack, } static inline void -fill_tcb_rcv(struct tcb *tcb, uint32_t seq, uint32_t wscale, - const union tle_tcp_tsopt *to) +sync_fill_tcb(struct tcb *tcb, const union seg_info *si, const union tsopt *to) { + uint32_t ack, mss, seq, wscale; + + seq = si->seq; + tcb->rcv.nxt = seq; tcb->rcv.irs = seq - 1; - tcb->rcv.ts = to->val; - tcb->rcv.wscale = (wscale == TCP_WSCALE_NONE) ? - TCP_WSCALE_NONE : TCP_WSCALE_DEFAULT; -} + tcb->snd.wu.wl1 = seq; + + ack = si->ack; -static inline void -fill_tcb_snd(struct tcb *tcb, uint32_t seq, uint32_t ack, uint32_t mss, - uint32_t wnd, uint32_t wscale, const union tle_tcp_tsopt *to) -{ tcb->snd.nxt = ack; tcb->snd.una = ack; tcb->snd.iss = ack - 1; tcb->snd.rcvr = ack - 1; - - tcb->snd.wu.wl1 = seq; tcb->snd.wu.wl2 = ack; - tcb->snd.mss = mss; - tcb->snd.ts = to->ecr; + mss = si->mss; - tcb->snd.wscale = wscale; - tcb->snd.wnd = wnd << wscale; -} + tcb->snd.mss = mss; + tcb->so.mss = mss; -static inline void -sync_fill_tcb(struct tcb *tcb, const union seg_info *si, - const union tle_tcp_tsopt *to) -{ - uint32_t ack, mss, seq, wscale; + tcb->snd.ts = to->ecr; + tcb->rcv.ts = to->val; + tcb->so.ts.raw = to->raw; - seq = si->seq; - ack = si->ack; - mss = si->mss; wscale = to->ecr & SYNC_TMS_WSCALE_MASK; - fill_tcb_snd(tcb, seq, ack, mss, si->wnd, wscale, to); - fill_tcb_rcv(tcb, seq, wscale, to); - - tcb->so.mss = mss; - tcb->so.ts.raw = to->raw; + tcb->snd.wscale = wscale; + tcb->snd.wnd = si->wnd << wscale; tcb->so.wscale = wscale; + + tcb->rcv.wscale = (wscale == TCP_WSCALE_NONE) ? + TCP_WSCALE_NONE : TCP_WSCALE_DEFAULT; } #ifdef __cplusplus |