Fix interface values not being set on RNodeSubInterface instances #556
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.
This one's on me. So, when I designed RNodeMultiInterface, it didn't occur to me that the interface values being set in
Reticulum.py
would not actually be set until after the class was initialised. And since these values are passed on to theRNodeSubInterface
before they're actually initialised, this created a problem. The actual values will never be set in the subinterface (which is the one actually processing packets).The way this manifested as a bug was in the fact that
self.OUT
would be set to false on all RNodeSubInterface instances until the interface was destroyed and recreated (i.e. through pulling the connection to the RNode). So, every first connection when the RNS daemon started would result in it not being able to transmit on any of the RNodeSubInterface instances. This would likely have other implications if not fixed as well, such as affecting IFAC or other things which are set on the interface after it is started.I don't know how you'll feel about the
.start()
call I made in this PR Mark. It would be entirely possible to create a thread to run in a second or so in the future after the__init__()
is called for RNodeMultiInterface in the actual class. That could be done, but I do have reservations about it potentially creating race conditions. At least in this current implementation, it should guarantee this issue does not resurface, but may not be to your liking as of current.