From a65e12b09dcc0219f140ff2c3147e027aa8f2d35 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 19 Oct 2005 09:37:52 +0000 Subject: [PATCH] Convert if (tp->t_state == TCPS_LISTEN) panic() into a KASSERT. MFC after: 2 weeks --- sys/netinet/tcp_input.c | 6 ++---- sys/netinet/tcp_reass.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 82a60dbb9bbb..7e2eba42e10b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1010,10 +1010,8 @@ tcp_input(m, off0) KASSERT(headlocked, ("tcp_input: after_listen: head not locked")); INP_LOCK_ASSERT(inp); - /* XXX temp debugging */ - /* should not happen - syncache should pick up these connections */ - if (tp->t_state == TCPS_LISTEN) - panic("tcp_input: TCPS_LISTEN"); + /* Syncache takes care of sockets in the listen state. */ + KASSERT(tp->t_state != TCPS_LISTEN, ("tcp_input: TCPS_LISTEN")); /* * This is the second part of the MSS DoS prevention code (after diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 82a60dbb9bbb..7e2eba42e10b 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1010,10 +1010,8 @@ tcp_input(m, off0) KASSERT(headlocked, ("tcp_input: after_listen: head not locked")); INP_LOCK_ASSERT(inp); - /* XXX temp debugging */ - /* should not happen - syncache should pick up these connections */ - if (tp->t_state == TCPS_LISTEN) - panic("tcp_input: TCPS_LISTEN"); + /* Syncache takes care of sockets in the listen state. */ + KASSERT(tp->t_state != TCPS_LISTEN, ("tcp_input: TCPS_LISTEN")); /* * This is the second part of the MSS DoS prevention code (after