[bt][l2cap] Reland "Guard against peer opening multiple dynamic channels from the same endpoint ID"

Original commit was 2b7d302a6b7d193804331fec210b33488d1c4b3d.

The crash that this was reverted for is fixed in f9adee40aa38ccc5d025c55b36e9245ef631fc9b.

Original change's description:
> Add checks in BrEdrDynamicChannel::OnRxConnRsp and BrEdrDynamicChannelRegistry::OnRxConnReq
> for responses/requests from a peer that reuse an already allocated dynamic channel ID. This would
> violate the spec.
>
> Add method DynamicChannelRegistry::FindChannelByRemoteId for looking up
> whether a peer CId is already in use.
>
> Renamed DynamicChannel::set_remote_cid to
> DynamicChannel::SetRemoteChannelId, it now verifies that a remote channel Id is
> unique before adding it.
>
> BUG: 694
>
> Test: in bt-host-unittests
> L2CAP_BrEdrDynamicChannelTest.InboundConnectionResponseReusingChannelIdCausesInboundChannelFailure
> L2CAP_BrEdrDynamicChannelTest.PeerConnectionResponseReusingChannelIdCausesOutboundChannelFailure
> L2CAP_BrEdrDynamicChannelTest.PeerPendingConnectionResponseReusingChannelIdCausesOutboundChannelFailure
>
> Change-Id: Ic58544b1f7d52b54fcd5d776b95a939c317747f1

Change-Id: I347ee6ba0a36ba0b3672158e3cb812f8b4364d76
7 files changed
tree: 7ddc072dfdfbbe89242b329679c79d5f568ffdbd
  1. .clang-format
  2. .clang-tidy
  3. .dir-locals.el
  4. .gitattributes
  5. .gitignore
  6. .gn
  7. .style.yapf
  8. AUTHORS
  9. BUILD.gn
  10. CODE_OF_CONDUCT.md
  11. CONTRIBUTING.md
  12. LICENSE
  13. OWNERS
  14. PATENTS
  15. README.md
  16. boards/
  17. build/
  18. bundles/
  19. docs/
  20. examples/
  21. garnet/
  22. peridot/
  23. products/
  24. rustfmt.toml
  25. scripts/
  26. sdk/
  27. src/
  28. third_party/
  29. tools/
  30. zircon/
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.