cmake: do not allow netlink support when external poll support is enabled. #3145
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.
Netlink fds are not passed to the user callback for external loop adoption, because vhost and its protocols are not yet in place when
rops_pt_init_destroy_netlink()
gets called during context creation. As a consequence, netlink fds are not polled, leading to outdated/missing routing table entries in the library, expecially when application starts at the same time of network itnerfaces. A complex rework would be required to support this, so for now disable netlink when external poll is needed.This is the function calls sequence:
lws_create_context()
callsLWS_ROPS_pt_init_destroy()
for every available role (so netlink too, on Linux)rops_pt_init_destroy_netlink()
creates the netlink fd, and passes it tolws_wsi_inject_to_loop()
, which then passes it to__insert_wsi_socket_into_fds()
LWS_WITH_EXTERNAL_POLL
is defined, normally the fd is passed toLWS_CALLBACK_ADD_POLL_FD
callback - butwsi->a.vhost
is not yet inited at this point - so fd is not passed to the application, which gets no chance of adding it to its own poll loopSo, netlink socket ends up being not polled, thus all the library logic on routing table entries is disrupted.
For this reason, if application needs
LWS_WITH_EXTERNAL_POLL
support, unfortunately it is better to disable netlink on Linux, too.