| 2899 | } |
| 2900 | |
| 2901 | static void |
| 2902 | tcp_mtudisc(struct inpcb *inp, int mtuoffer) |
| 2903 | { |
| 2904 | struct tcpcb *tp; |
| 2905 | struct socket *so; |
| 2906 | |
| 2907 | INP_WLOCK_ASSERT(inp); |
| 2908 | if ((inp->inp_flags & INP_TIMEWAIT) || |
| 2909 | (inp->inp_flags & INP_DROPPED)) |
| 2910 | return; |
| 2911 | |
| 2912 | tp = intotcpcb(inp); |
| 2913 | KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); |
| 2914 | |
| 2915 | tcp_mss_update(tp, -1, mtuoffer, NULL, NULL); |
| 2916 | |
| 2917 | so = inp->inp_socket; |
| 2918 | SOCKBUF_LOCK(&so->so_snd); |
| 2919 | /* If the mss is larger than the socket buffer, decrease the mss. */ |
| 2920 | if (so->so_snd.sb_hiwat < tp->t_maxseg) |
| 2921 | tp->t_maxseg = so->so_snd.sb_hiwat; |
| 2922 | SOCKBUF_UNLOCK(&so->so_snd); |
| 2923 | |
| 2924 | TCPSTAT_INC(tcps_mturesent); |
| 2925 | tp->t_rtttime = 0; |
| 2926 | tp->snd_nxt = tp->snd_una; |
| 2927 | tcp_free_sackholes(tp); |
| 2928 | tp->snd_recover = tp->snd_max; |
| 2929 | if (tp->t_flags & TF_SACK_PERMIT) |
| 2930 | EXIT_FASTRECOVERY(tp->t_flags); |
| 2931 | tp->t_fb->tfb_tcp_output(tp); |
| 2932 | } |
| 2933 | |
| 2934 | #ifdef INET |
| 2935 | /* |
no test coverage detected