Skip to content

fix(udp): resolve adapter name to IPv4 address before UDP bind - #831

Open
eliagiesslerBMW wants to merge 1 commit into
COVESA:masterfrom
eliagiesslerBMW:resolve_adapter_name_udp_dlt_before_bind
Open

eliagiesslerBMW wants to merge 1 commit into
COVESA:masterfrom
eliagiesslerBMW:resolve_adapter_name_udp_dlt_before_bind

Conversation

@eliagiesslerBMW

@eliagiesslerBMW eliagiesslerBMW commented Sep 2, 2026 •

Copy link
Copy Markdown

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.

@bunty95
bunty95 force-pushed the resolve_adapter_name_udp_dlt_before_bind branch from 02ca7d8 to e02f640 Compare September 25, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant