Skip to content

fix: set sd_route_set_ on non-Linux platforms in start_ip_routing#1027

Open
aki1770-del wants to merge 1 commit intoCOVESA:masterfrom
aki1770-del:fix/sd-route-not-set-non-linux-994
Open

fix: set sd_route_set_ on non-Linux platforms in start_ip_routing#1027
aki1770-del wants to merge 1 commit intoCOVESA:masterfrom
aki1770-del:fix/sd-route-not-set-non-linux-994

Conversation

@aki1770-del
Copy link
Copy Markdown

Problem

is_external_routing_ready() returns:

return if_state_running_ && (!configuration_->is_sd_enabled() || (configuration_->is_sd_enabled() && sd_route_set_));

On Linux, both if_state_running_ and sd_route_set_ are set by on_net_interface_or_route_state_changed(), which is invoked by the netlink connector when the network interface and SD multicast route become available.

On _WIN32 and __QNX__ (no netlink connector), on_net_interface_or_route_state_changed() is never called:

  • start_ip_routing() already sets if_state_running_ = true for these platforms
  • But sd_route_set_ stays false (initialized in the constructor, never updated)

Result: when Service Discovery is enabled, is_external_routing_ready() always returns false on these platforms, so discovery_->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_ = true alongside if_state_running_ = true inside the existing #if defined(_WIN32) || defined(__QNX__) guard in start_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_notification is at its default (true) and the netlink connector is absent.

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
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.

[BUG]: check_options_queue can never return true on non-linux platforms?

1 participant