A number of patches in the last years have created new return paths

in tcp_input that leave the function before hitting the tcp_trace
function call for the TCPDEBUG option. This has made TCPDEBUG mostly
useless (and tools like ports/benchmarks/dbs not working). Add
tcp_trace calls to the return paths that could be identified in this
maze.

This is a NOP unless you compile with TCPDEBUG.
This commit is contained in:
harti 2003-08-13 08:46:54 +00:00
parent d199702b34
commit 88c7bba592
2 changed files with 42 additions and 0 deletions

View File

@ -445,6 +445,10 @@ tcp_input(m, off0)
ip->ip_len +
IPPROTO_TCP));
th->th_sum ^= 0xffff;
#ifdef TCPDEBUG
ipov->ih_len = (u_short)tlen;
ipov->ih_len = htons(ipov->ih_len);
#endif
} else {
/*
* Checksum extended TCP header and data.
@ -864,6 +868,11 @@ tcp_input(m, off0)
* for syncache, or perform t/tcp connection.
*/
if (so->so_qlen <= so->so_qlimit) {
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, &tcp_savetcp, 0);
#endif
tcp_dooptions(&to, optp, optlen, 1);
if (!syncache_add(&inc, &to, th, &so, m))
goto drop;
@ -1058,6 +1067,13 @@ tcp_input(m, off0)
* wakeup/selwakeup/signal. If data
* are ready to send, let tcp_output
* decide between more output or persist.
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen,
&tcp_savetcp, 0);
#endif
*/
if (tp->snd_una == tp->snd_max)
callout_stop(tp->tt_rexmt);
@ -1097,6 +1113,11 @@ tcp_input(m, off0)
tcpstat.tcps_rcvbyte += tlen;
ND6_HINT(tp); /* some progress has been done */
/*
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, &tcp_savetcp, 0);
#endif
* Add data to socket buffer.
*/
if (so->so_state & SS_CANTRCVMORE) {

View File

@ -445,6 +445,10 @@ tcp_input(m, off0)
ip->ip_len +
IPPROTO_TCP));
th->th_sum ^= 0xffff;
#ifdef TCPDEBUG
ipov->ih_len = (u_short)tlen;
ipov->ih_len = htons(ipov->ih_len);
#endif
} else {
/*
* Checksum extended TCP header and data.
@ -864,6 +868,11 @@ tcp_input(m, off0)
* for syncache, or perform t/tcp connection.
*/
if (so->so_qlen <= so->so_qlimit) {
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, &tcp_savetcp, 0);
#endif
tcp_dooptions(&to, optp, optlen, 1);
if (!syncache_add(&inc, &to, th, &so, m))
goto drop;
@ -1058,6 +1067,13 @@ tcp_input(m, off0)
* wakeup/selwakeup/signal. If data
* are ready to send, let tcp_output
* decide between more output or persist.
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen,
&tcp_savetcp, 0);
#endif
*/
if (tp->snd_una == tp->snd_max)
callout_stop(tp->tt_rexmt);
@ -1097,6 +1113,11 @@ tcp_input(m, off0)
tcpstat.tcps_rcvbyte += tlen;
ND6_HINT(tp); /* some progress has been done */
/*
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp,
(void *)tcp_saveipgen, &tcp_savetcp, 0);
#endif
* Add data to socket buffer.
*/
if (so->so_state & SS_CANTRCVMORE) {