aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
diff options
context:
space:
mode:
authorMaksim Yevmenkin <emax@FreeBSD.org>2005-08-31 18:13:23 +0000
committerMaksim Yevmenkin <emax@FreeBSD.org>2005-08-31 18:13:23 +0000
commit82e1becc5fe5b223116f2f75a8f16a7756faae30 (patch)
tree723ee550e984161491555f7f607278306e152baf /sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
parent7b7b9810bd0c9598201d349d4bb278eb5fe857f1 (diff)
downloadsrc-82e1becc5fe5b223116f2f75a8f16a7756faae30.tar.gz
src-82e1becc5fe5b223116f2f75a8f16a7756faae30.zip
Notes
Diffstat (limited to 'sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c')
-rw-r--r--sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
index 10eb89eea5d1..635298a4e3d3 100644
--- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
+++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c
@@ -182,12 +182,14 @@ ng_l2cap_con_unref(ng_l2cap_con_p con)
* 2) connection is in OPEN state
* 3) it is an outgoing connection
* 4) disconnect timeout > 0
+ * 5) connection is not dying
*/
if ((con->refcnt == 0) &&
(con->state == NG_L2CAP_CON_OPEN) &&
(con->flags & NG_L2CAP_CON_OUTGOING) &&
- (con->l2cap->discon_timo > 0))
+ (con->l2cap->discon_timo > 0) &&
+ ((con->flags & NG_L2CAP_CON_DYING) == 0))
ng_l2cap_discon_timeout(con);
} /* ng_l2cap_con_unref */
@@ -273,11 +275,14 @@ ng_l2cap_free_con(ng_l2cap_con_p con)
ng_l2cap_free_cmd(cmd);
}
+ if (con->flags & (NG_L2CAP_CON_AUTO_DISCON_TIMO|NG_L2CAP_CON_LP_TIMO))
+ panic(
+"%s: %s - timeout pending! state=%d, flags=%#x\n",
+ __func__, NG_NODE_NAME(con->l2cap->node),
+ con->state, con->flags);
+
LIST_REMOVE(con, next);
- if (con->flags & NG_L2CAP_CON_AUTO_DISCON_TIMO)
- ng_l2cap_discon_untimeout(con);
- if (con->flags & NG_L2CAP_CON_LP_TIMO)
- ng_l2cap_lp_untimeout(con);
+
bzero(con, sizeof(*con));
FREE(con, M_NETGRAPH_L2CAP);
} /* ng_l2cap_free_con */