Index: netinet/tcp_subr.c =================================================================== --- netinet/tcp_subr.c (revision 230489) +++ netinet/tcp_subr.c (working copy) @@ -1410,9 +1410,11 @@ */ if (mtu <= tcp_maxmtu(&inc, NULL)) tcp_hc_updatemtu(&inc, mtu); - } - - inp = (*notify)(inp, inetctlerrmap[cmd]); + /* XXXAO: Slighly hackish. */ + inp = (*notify)(inp, mtu); + } else + inp = (*notify)(inp, + inetctlerrmap[cmd]); } } if (inp != NULL) @@ -1656,12 +1658,15 @@ * based on the new value in the route. Also nudge TCP to send something, * since we know the packet we just sent was dropped. * This duplicates some code in the tcp_mss() function in tcp_input.c. + * + * XXXAO: Slight abuse of 'errno'. */ struct inpcb * tcp_mtudisc(struct inpcb *inp, int errno) { struct tcpcb *tp; struct socket *so; + int mtu; INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || @@ -1671,7 +1676,12 @@ tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); - tcp_mss_update(tp, -1, NULL, NULL); + /* Extract the MTU from errno for IPv4. */ + if (errno > PRC_NCMDS) + mtu = errno; + else + mtu = -1; + tcp_mss_update(tp, mtu, NULL, NULL); so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd);