tcp timer: Don't try stopping timers if timer message is not created.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 23 May 2009 11:01:15 +0000 (19:01 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 23 May 2009 11:33:08 +0000 (19:33 +0800)
DragonFly-bug: <http://bugs.dragonflybsd.org/issue1380>

sys/netinet/tcp_subr.c

index 7c08586..817c258 100644 (file)
@@ -859,9 +859,10 @@ tcp_close(struct tcpcb *tp)
        /*
         * Make sure that all of our timers are stopped before we
         * delete the PCB.  For listen TCP socket (tp->tt_msg == NULL),
-        * timers are never used.
+        * timers are never used.  If timer message is never created
+        * (tp->tt_msg->tt_tcb == NULL), timers are never used too.
         */
-       if (tp->tt_msg != NULL) {
+       if (tp->tt_msg != NULL && tp->tt_msg->tt_tcb != NULL) {
                tcp_callout_stop(tp, tp->tt_rexmt);
                tcp_callout_stop(tp, tp->tt_persist);
                tcp_callout_stop(tp, tp->tt_keep);