Skip to content
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

Fix checking channel name #1736

Merged
merged 2 commits into from
Oct 1, 2022
Merged

Fix checking channel name #1736

merged 2 commits into from
Oct 1, 2022

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Oct 1, 2022

In order to check whether an incoming packet arrived at the correct channel, amongst others the channel name was compared with the 'boundChannel' of the module. This was done using strcmp, which returns zero if strings are equal. In this commit this was changed to checking for 'true'.

With this PR it checks for zero again, so e.g. an Admin packet on the primary channel is not allowed anymore:

07:06:24 52 [RadioIf] Lora RX (id=0x543c64b5 Fr0xe4 To0x34, WantAck1, HopLim3 Ch0x8 encrypted rxSNR=12.75 rxRSSI=1.84101)
07:06:24 52 [RadioIf] AirTime - Packet received : 649ms
07:06:24 52 [Router] Add packet record (id=0x543c64b5 Fr0xe4 To0x34, WantAck1, HopLim3 Ch0x8 encrypted rxSNR=12.75 rxRSSI=1.84101)
07:06:24 52 [Router] Using channel 0 (hash 0x8)
07:06:24 52 [Router] Expanding short PSK #1
07:06:24 52 [Router] Using AES128 key!
07:06:24 52 [Router] ESP32 crypt fr=bff18ce4, num=543c64b5, numBytes=8!
07:06:24 52 [Router] decoded message (id=0x543c64b5 Fr0xe4 To0x34, WantAck1, HopLim3 Ch0x0 Portnum=6 WANTRESP rxtime=1664607984 rxSNR=12.75 rxRSSI=1.84101)
07:06:24 52 [Router] handleReceived(REMOTE) (id=0x543c64b5 Fr0xe4 To0x34, WantAck1, HopLim3 Ch0x0 Portnum=6 WANTRESP rxtime=1664607984 rxSNR=12.75 rxRSSI=1.84101)
07:06:24 52 [Router] Module 'Admin' wantsPacket=1
07:06:24 52 [Router] packet on wrong channel, returning error (id=0x543c64b5 Fr0xe4 To0x34, WantAck1, HopLim3 Ch0x0 Portnum=6 WANTRESP rxtime=1664607984 rxSNR=12.75 rxRSSI=1.84101)
07:06:24 52 [Router] Alloc an err=33,to=0xbff18ce4,idFrom=0x543c64b5,id=0x1b93d200

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2022

🤖 Pull request artifacts

file commit
pr1736-firmware-1.3.42.3669cf7.zip 3669cf7

thebentern added a commit to meshtastic/artifacts that referenced this pull request Oct 1, 2022
@thebentern
Copy link
Contributor

thebentern commented Oct 1, 2022

Great fix!

@thebentern thebentern merged commit 82ba958 into meshtastic:master Oct 1, 2022
@andrekir
Copy link
Member

andrekir commented Oct 1, 2022

looks great, thank you!

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.

3 participants