Skip to content

Bluetooth: L2CAP signaling channel: better default id, because 0 is an invalid id per the spec #4734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XenoKovah
Copy link
Contributor

Per the Bluetooth 5.4 spec page 1043: "Signaling identifier 0x00 is an invalid identifier and shall never be used in any command."

The use of an id field of 0 here forces a scapy user to override the field instead of just using it as is for the first packet.

… so people don't need to override the default.
Copy link

codecov bot commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.31%. Comparing base (0648c0d) to head (25c4a44).

❗ There is a different number of reports uploaded between BASE (0648c0d) and HEAD (25c4a44). Click for more details.

HEAD has 11 uploads less than BASE
Flag BASE (0648c0d) HEAD (25c4a44)
12 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4734       +/-   ##
===========================================
- Coverage   82.20%   48.31%   -33.89%     
===========================================
  Files         361      343       -18     
  Lines       87195    86921      -274     
===========================================
- Hits        71679    41998    -29681     
- Misses      15516    44923    +29407     
Files with missing lines Coverage Δ
scapy/layers/bluetooth.py 83.74% <ø> (-6.73%) ⬇️

... and 313 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XenoKovah XenoKovah changed the title Bluetooth: L2CAP signaling channel: better default id, because 0 is a invalid id per the spec Bluetooth: L2CAP signaling channel: better default id, because 0 is an invalid id per the spec May 7, 2025
@antoniovazquezblanco
Copy link
Contributor

There are a set of tests that seem to be dependent of the default value of some packets, for this reason, this PR breaks testing:

failed 34B7B7FD 000.00s Test HCI_PHDR_Hdr
failed 88BBF466 000.00s Basic HCI_ACL_Hdr build & dissect
failed E06C4A06 000.00s Complex HCI - L2CAP build
failed F536B25B 000.00s HCI - L2CAP Echo test
failed 15D30BED 000.00s HCI - L2CAP Create Channel request

I would say that for those tests where a packet is built using the constructors and then the raw values are checked, that all fields should be specified if possible to avoid breakage like this...
Maybe some of those tests could be removed because some of them do not seem to have a very clear intent and purpose...

Let's see what the maintainers have to say...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants