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

LMIC validDR() doesn't check out-of-range #723

Closed
terrillmoore opened this issue Apr 29, 2021 · 2 comments
Closed

LMIC validDR() doesn't check out-of-range #723

terrillmoore opened this issue Apr 29, 2021 · 2 comments
Assignees
Labels

Comments

@terrillmoore
Copy link
Member

If you pass an invalid value to validDR() [off end of table], it returns garbage. Unfortunately, MAC commands use DRs and assume validDR() will do the right thing. And the compliance test for EU sends invalid DRs (section 5.4).

@terrillmoore terrillmoore self-assigned this Apr 29, 2021
@terrillmoore
Copy link
Member Author

The implementation is inherently somewhat fragile. But the solution is to make validDR() a region-sensitive API, so that it co-resides with the implementation of _DR2RPS_CRC, allowing it to check against the size.

@terrillmoore
Copy link
Member Author

Fixing this requires moving some material from lorabase.h to an LMIC-specific file. Those items (some static inline functions) actually already were LMIC-specific, but didn't really depend on the new region scheme... apparently. They're all in-scope for clients after #include "lmic.h", so we can't just rip them out. Moving them to lmic_bandplan.h will make things work.

nielskoot added a commit to nielskoot/arduino-lmic that referenced this issue Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant