fix: increase kMaxUriBytes from 30 to 64 for ohNet 1.40 IPv6 support#7
Open
kylegordon wants to merge 1 commit into
Open
fix: increase kMaxUriBytes from 30 to 64 for ohNet 1.40 IPv6 support#7kylegordon wants to merge 1 commit into
kylegordon wants to merge 1 commit into
Conversation
ohNet 1.40 changed TIpAddress from a plain uint32 to a struct with IPv6
support and bumped Endpoint::kMaxEndpointBytes from ~21 to 48. OhmSender
calls AppendEndpoint() on iUri (a Bws<kMaxUriBytes>) after writing a
6-byte scheme prefix ("ohm://" or "ohu://"), leaving only 24 bytes of
capacity. AppendEndpoint() asserts remaining >= kMaxEndpointBytes (48),
so the assertion always fires on startup when a sender is created.
Increase kMaxUriBytes to 64: 6 (scheme) + 48 (max endpoint) + 10 margin.
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
ohNet 1.40 changed
TIpAddressfrom a plainuint32_tto a struct withIPv6 support, and bumped
Endpoint::kMaxEndpointBytesfrom ~21 to 48.OhmSendercallsAppendEndpoint()oniUri(aBws<kMaxUriBytes>)after writing the 6-byte scheme prefix (
ohm://orohu://), leavingonly 24 bytes of remaining capacity.
AppendEndpoint()asserts:This causes an
AssertionFailedcrash in theDeviceListUpdaterthreadon startup whenever a Songcast sender is created.
Fix
Increase
kMaxUriBytesto 64: 6 bytes (scheme prefix) + 48 bytes(
Endpoint::kMaxEndpointBytes) + 10 bytes margin.Test
Verified by running against a live network with multiple Linn Receiver
devices — senders now create and start without crashing.