fix: set sd_route_set_ on non-Linux platforms in start_ip_routing#1027
Open
aki1770-del wants to merge 1 commit intoCOVESA:masterfrom
Open
fix: set sd_route_set_ on non-Linux platforms in start_ip_routing#1027aki1770-del wants to merge 1 commit intoCOVESA:masterfrom
aki1770-del wants to merge 1 commit intoCOVESA:masterfrom
Conversation
On Linux, on_net_interface_or_route_state_changed() is called by the netlink connector when a route becomes available, which sets sd_route_set_ = true and eventually allows is_external_routing_ready() to return true, enabling service discovery multicast startup. On _WIN32 and __QNX__ (platforms without a netlink connector), on_net_interface_or_route_state_changed() is never invoked, so sd_route_set_ stays false indefinitely. As a result, is_external_routing_ready() always returns false when SD is enabled, blocking discovery from starting (issues COVESA#979, COVESA#810). start_ip_routing() already sets if_state_running_ = true for these platforms. Set sd_route_set_ = true at the same site so both conditions required by is_external_routing_ready() are satisfied when IP routing is explicitly started. Fixes COVESA#994
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
is_external_routing_ready()returns:On Linux, both
if_state_running_andsd_route_set_are set byon_net_interface_or_route_state_changed(), which is invoked by the netlink connector when the network interface and SD multicast route become available.On
_WIN32and__QNX__(no netlink connector),on_net_interface_or_route_state_changed()is never called:start_ip_routing()already setsif_state_running_ = truefor these platformssd_route_set_staysfalse(initialized in the constructor, never updated)Result: when Service Discovery is enabled,
is_external_routing_ready()always returnsfalseon these platforms, sodiscovery_->start()is never reached and multicast SD never begins. This explains the related issues #979 and #810 on non-Linux targets.Fixes #994.
Fix
Set
sd_route_set_ = truealongsideif_state_running_ = trueinside the existing#if defined(_WIN32) || defined(__QNX__)guard instart_ip_routing(). Since there is no netlink on these platforms, the route can be considered available when IP routing explicitly starts.Testing
Verified on QNX: SD multicast now starts correctly when
wait_route_netlink_notificationis at its default (true) and the netlink connector is absent.