When generating a TCP response to a connection, not only test if the

tcpcb is NULL, but also its connected inpcb, since we now allow
elements of a TCP connection to hang around after other state, such
as the socket, has been recycled.

Tested by:	dcs
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
This commit is contained in:
Robert Watson 2003-02-25 14:08:41 +00:00
parent a4910cd21c
commit 9327ee33bf
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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.