-void
-tcp_init_mss (tcp_connection_t * tc)
-{
- u16 default_min_mss = 536;
- tcp_update_rcv_mss (tc);
-
- /* TODO cache mss and consider PMTU discovery */
- tc->snd_mss = clib_min (tc->rcv_opts.mss, tc->mss);
-
- if (tc->snd_mss < 45)
- {
- /* Assume that at least the min default mss works */
- tc->snd_mss = default_min_mss;
- tc->rcv_opts.mss = default_min_mss;
- }
-
- /* We should have enough space for 40 bytes of options */
- ASSERT (tc->snd_mss > 45);
-
- /* If we use timestamp option, account for it */
- if (tcp_opts_tstamp (&tc->rcv_opts))
- tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP;
-}