Max,
I was going to just drop the frame and log an error. The=20
thing is, if the packet header is corrupted (i.e. wrong=20
length, etc) we can't really trust its content. I mean if=20
length is wrong how do we know that CID is right. It means=20
that we don't really know which channel should be closed=20
(i.e. which app should be notified).
Here's Cetecom's response to your comment:
"Good point ! I agree, in a messed up remote L2CAP stack, CID could be wron=
g
as well if length is wrong. But I think it is a good approach to check
first, if that CID exists and if yes, notify the app about that channel."
So how about we do this: As above, if it exists then we close it. If not,
we log an error.
-Daryl.