diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-03-26 01:33:41 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-03-26 01:33:41 +0000 |
commit | 46492ab6604a4e31629809cf807aab827d7be8e5 (patch) | |
tree | a4c7639265c289cb5190edeaa1dedbf4f837f5b9 /sys/netinet/tcp_timer.c | |
parent | 2f146bc4fd3bffebc6a8e11d8b6705fbfb27e64f (diff) | |
download | FreeBSD-src-46492ab6604a4e31629809cf807aab827d7be8e5.zip FreeBSD-src-46492ab6604a4e31629809cf807aab827d7be8e5.tar.gz |
Explicitly assert socket pointer is non-NULL in tcp_input() so as to
provide better debugging information.
Prefer explicit comparison to NULL for tcpcb pointers rather than
treating them as booleans.
MFC after: 1 month
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index b9d24a8..45808af 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -195,11 +195,11 @@ tcp_timer_2msl(xtp) tp = tcp_close(tp); #ifdef TCPDEBUG - if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif - if (tp) + if (tp != NULL) INP_UNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); } @@ -353,11 +353,11 @@ dropit: tp = tcp_drop(tp, ETIMEDOUT); #ifdef TCPDEBUG - if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif - if (tp) + if (tp != NULL) INP_UNLOCK(tp->t_inpcb); INP_INFO_WUNLOCK(&tcbinfo); } @@ -412,11 +412,11 @@ tcp_timer_persist(xtp) out: #ifdef TCPDEBUG - if (tp && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) + if (tp != NULL && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif - if (tp) + if (tp != NULL) INP_UNLOCK(inp); INP_INFO_WUNLOCK(&tcbinfo); } @@ -560,11 +560,11 @@ tcp_timer_rexmt(xtp) out: #ifdef TCPDEBUG - if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif - if (tp) + if (tp != NULL) INP_UNLOCK(inp); if (headlocked) INP_INFO_WUNLOCK(&tcbinfo); |