fix(udp): resolve adapter name to IPv4 address before UDP bind - #831
Open
eliagiesslerBMW wants to merge 1 commit into
Open
eliagiesslerBMW wants to merge 1 commit into
eliagiesslerBMW wants to merge 1 commit into
Conversation
bunty95
force-pushed
the
resolve_adapter_name_udp_dlt_before_bind
branch
from
September 25, 2026 11:41
02ca7d8 to
e02f640
Compare
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.
Resolves adapter display name (e.g. "DLT") to its IPv4 address before binding the UDP socket, since QHostAddress cannot parse adapter names directly. Fixes 'Binding failed' errors when the Receiving interface field is set to an adapter name instead of an IP address.
Note on Qt5 vs Qt6 behavior: This bug is reproducible with Qt6 builds (confirmed on 6.8.3) — binding fails with a generic "Unknown error" when the "Receiving interface" field contains an adapter's display name (e.g. "DLT", "CP60") instead of an IP address, because QHostAddress(QString) cannot parse non-numeric strings and leaves the address in a null/UnknownNetworkLayerProtocol state (confirmed in Qt's own qhostaddress.cpp).
Colleagues running official Qt5-based stable releases of DLT Viewer do not observe this failure with the same renamed-interface configuration — the socket bind apparently succeeds despite the same invalid input. This is likely due to differences in Qt5's vs Qt6's underlying socket engine handling of an address with UnknownNetworkLayerProtocol during bind() (Qt6 substantially rewrote the network backend), though the exact code path responsible hasn't been traced. Regardless of the underlying Qt-version-dependent behavior, relying on an unparseable string being silently accepted by bind() was never correct or guaranteed — this fix removes that dependency entirely by resolving the interface name to an actual IPv4 address before binding.