diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f6708b3579af..d92cbf54a31d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -484,7 +484,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) m->m_pkthdr.len = tlen; m->m_pkthdr.rcvif = (struct ifnet *) 0; #ifdef MAC - if (tp != NULL) { + if (tp != NULL && tp->t_inpcb != NULL) { /* * Packet is associated with a socket, so allow the * label of the response to reflect the socket label. diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index f6708b3579af..d92cbf54a31d 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -484,7 +484,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) m->m_pkthdr.len = tlen; m->m_pkthdr.rcvif = (struct ifnet *) 0; #ifdef MAC - if (tp != NULL) { + if (tp != NULL && tp->t_inpcb != NULL) { /* * Packet is associated with a socket, so allow the * label of the response to reflect the socket label.