FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

common: featurebits_unset cleared the whole byte by kwsantiago · Pull Request #9533 · ElementsProject/lightning · GitHub

Repository navigation

common: featurebits_unset cleared the whole byte - #9533

Open
kwsantiago wants to merge 2 commits into
ElementsProject:masterfrom
privkeyio:up-featurebits
Open

kwsantiago wants to merge 2 commits into
ElementsProject:masterfrom
privkeyio:up-featurebits

Conversation

kwsantiago commented Sep 20, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

0 << n is always 0, so the mask clears every bit in the byte rather than the one asked for.

channel_type_accept() is the only caller: it blanks the variants (option_scid_alias 46, option_zeroconf 50) before comparing the proposal against the known types. Blanking 46 also clears bits 40-47, so option_provide_storage (42) and option_channel_type (44) disappear from the copy being compared, and a proposal carrying any of them still matches a known type. The type that gets stored afterwards is the peer's original vector, not the blanked one.

Nothing reads those bits back out of a channel type today, so this is a latent hole rather than a live bug.

Test added first; it fails on the current code:

run-features: common/test/run-features.c:226: test_featurebits_unset: Assertion `feature_offered(bits, 44)' failed.

Changelog-None

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL