From ac2ed142c15e8e7d743a3d470fd5d49e30285e32 Mon Sep 17 00:00:00 2001 From: plunky Date: Tue, 20 Mar 2007 20:25:24 +0000 Subject: [PATCH] discard inbound packets if the channel is not open --- sys/netbt/l2cap_lower.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/netbt/l2cap_lower.c b/sys/netbt/l2cap_lower.c index 69fc04aad424..ad1fadc7a0b0 100644 --- a/sys/netbt/l2cap_lower.c +++ b/sys/netbt/l2cap_lower.c @@ -1,4 +1,4 @@ -/* $NetBSD: l2cap_lower.c,v 1.3 2007/03/15 19:47:50 plunky Exp $ */ +/* $NetBSD: l2cap_lower.c,v 1.4 2007/03/20 20:25:24 plunky Exp $ */ /*- * Copyright (c) 2005 Iain Hibbert. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: l2cap_lower.c,v 1.3 2007/03/15 19:47:50 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: l2cap_lower.c,v 1.4 2007/03/20 20:25:24 plunky Exp $"); #include #include @@ -134,7 +134,8 @@ l2cap_recv_frame(struct mbuf *m, struct hci_link *link) } chan = l2cap_cid_lookup(hdr.dcid); - if (chan != NULL && chan->lc_link == link) { + if (chan != NULL && chan->lc_link == link + && chan->lc_state == L2CAP_OPEN) { (*chan->lc_proto->input)(chan->lc_upper, m); return; }