diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 476b578731d0..1c0d73ac76dd 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1158,6 +1158,16 @@ tcp_sendoob(struct socket *so, struct mbuf *m, struct mbuf *control) m_freem(control); return error; } + if (tp->t_template == NULL) { + /* + * XXX FreeBSD appears to open the connection + * automagically in this case, but the socket address + * isn't passed through here so we can't do that. + */ + m_freem(m); + m_freem(control); + return ENOTCONN; + } ostate = tcp_debug_capture(tp, PRU_SENDOOB);