cmake: do not allow netlink support when external poll support is enabled.#3145
cmake: do not allow netlink support when external poll support is enabled.#3145p-luke wants to merge 1 commit intowarmcat:mainfrom
Conversation
…bled. 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/wrong routing table entries in the library. A complex rework would be required to support this, so for now disable netlink when external poll is needed.
|
Thanks for the explanation... isn't it better to solve this by finally removing EXTERNAL_POLL? There's support for custom eventlib stuff now that should be better in every way. Or can't netlink be initialized later when EXTERNAL_POLL can handle it? |
I was trying to analyze |
|
Maybe it's enough if the Netlink role sees that you're using EXTERNAL_POLL and defers initializing it until you do it manually after the start of EXTERNAL_POLL |
|
I am not sure on how to achieve this deferred initialization. Netlink role gets called via |
fd918f2 to
207d634
Compare
dd2700b to
f96cb33
Compare
a800d4a to
7f2f518
Compare
baf4897 to
0c7fa23
Compare
2b74af4 to
5f77374
Compare
a677221 to
0c67054
Compare
f5fa440 to
278c671
Compare
580b993 to
c837e3f
Compare
260929d to
f06bf53
Compare
fb3f410 to
d8c745e
Compare
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_POLLis defined, normally the fd is passed toLWS_CALLBACK_ADD_POLL_FDcallback - butwsi->a.vhostis 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_POLLsupport, unfortunately it is better to disable netlink on Linux, too.