Repository navigation
Conversation
Transport::probe_request_handler increments _probes_received unconditionally, but the counter is only declared and defined when RNS_NEIGHBOR_PROBING is enabled, so compiling the feature out fails: Transport.cpp:4307: error: '_probes_received' was not declared in this scope Guard the increment like the counter's declaration, definition, getter and metric. The probe responder itself is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Type.hdocuments-DRNS_NEIGHBOR_PROBING=0as the way to compile neighbor probing out entirely, but the build fails with it on currentmaster(40fa628):Transport::probe_request_handlerincrements_probes_receivedunconditionally, while the counter's declaration, definition, getter (probes_received()) and its provisioning metric are all inside#if RNS_NEIGHBOR_PROBING. Anyone who disables the feature (for example to save flash or to avoid probe traffic on a shared channel) cannot build the library.To reproduce:
PLATFORMIO_BUILD_FLAGS=-DRNS_NEIGHBOR_PROBING=0 pio run -e native.Change
Wrap the increment in
#if RNS_NEIGHBOR_PROBING, matching the guards around the rest of the counter. Two lines, no behavior change with the default setting.The probe responder (
_probe_destination, enabled byReticulum::probe_destination_enabled()) is created and answers probes either way; with the feature off it simply does not count them, which is consistent withprobes_received()not existing in that configuration. An alternative would be to move_probes_receivedout of the guard because it counts responder-side traffic, but that changes the public API surface of the feature flag, so I kept the minimal fix.Testing
RNS_NEIGHBOR_PROBINGnative(Ubuntu 24.04, GCC 13.3, PlatformIO 6.2.0),masternative, this branchpio test -e native: 181/181 passednative, this branchpio test -e native: 182/182 passedttgo-t-beam(ESP32), this branchwiscore_rak4631(nRF52840), this branchNot tested on hardware: the change only affects compilation, and with the default setting the compiled code is identical.
Found while using microReticulum in WICI, where we build with neighbor probing disabled and have carried this as a local patch.
🤖 Generated with Claude Code