tcp_input: move tcp_debug_print_state to prevent accessing pcb when it might already be deallocated due to calling tcp_abort in tcp_process.

This commit is contained in:
goldsimon 2009-11-20 16:56:25 +00:00
parent b30c6f8b9e
commit 98a58f9e67

View File

@ -342,6 +342,11 @@ tcp_input(struct pbuf *p, struct netif *inp)
tcp_output(pcb);
}
}
#if TCP_INPUT_DEBUG
#if TCP_DEBUG
tcp_debug_print_state(pcb->state);
#endif /* TCP_DEBUG */
#endif /* TCP_INPUT_DEBUG */
}
@ -351,12 +356,6 @@ tcp_input(struct pbuf *p, struct netif *inp)
pbuf_free(inseg.p);
inseg.p = NULL;
}
#if TCP_INPUT_DEBUG
#if TCP_DEBUG
tcp_debug_print_state(pcb->state);
#endif /* TCP_DEBUG */
#endif /* TCP_INPUT_DEBUG */
} else {
/* If no matching PCB was found, send a TCP RST (reset) to the