l4p/tcp: Fix setting MSS in TCP stream establish 61/34161/1
authorKonstantin Ananyev <[email protected]>
Thu, 14 Oct 2021 12:49:41 +0000 (12:49 +0000)
committerKonstantin Ananyev <[email protected]>
Tue, 19 Oct 2021 15:40:00 +0000 (15:40 +0000)
Inside tcb_establish() we should check provided destionation MTU
information and adjust provided MSS value if necessary.

Signed-off-by: Konstantin Ananyev <[email protected]>
Change-Id: I66b64ec2a7b170dc62bf9cb604c2b83bfd1ea33f

lib/libtle_l4p/tcp_rxtx.c

index bf79eab..20a2665 100644 (file)
@@ -2265,12 +2265,13 @@ tle_tcp_stream_connect(struct tle_stream *ts, const struct sockaddr *addr)
 static inline void
 tcb_establish(struct tle_tcp_stream *s, const struct tle_tcp_conn_info *ci)
 {
-       uint32_t tms;
+       uint32_t mss, tms;
 
        tms = tcp_get_tms(s->s.ctx->cycles_ms_shift);
+       mss = calc_smss(ci->so.mss, &s->tx.dst);
 
        s->tcb.so = ci->so;
-       fill_tcb_snd(&s->tcb, ci->ack, ci->seq, ci->so.mss,
+       fill_tcb_snd(&s->tcb, ci->ack, ci->seq, mss,
                ci->wnd, ci->so.wscale, &ci->so.ts);
        fill_tcb_rcv(&s->tcb, ci->ack, ci->so.wscale, &ci->so.ts);