Closed DerZade closed 1 year ago
Hi @DerZade, I apologize for the delay. How would you suggest using CMD? One additional clarification that I wanted to understand is whether this is actually a multicast message or not. For example, my understanding is that multicast messages only are sent if you're subscribed to a multicast group, so is the socket in your example subscribed to any multicast groups? If not, we can absolutely try to have better heuristics for determining whether a message is a multicast message or not. I still haven't found a good way to infallibly determine that from the netlink header.
I appreciate you providing feedback. I've left the 0.7.0 release as a release candidate for now largely because I wanted people to test it and open issues before the final release. This is very helpful, so I'm happy to work with you to have it meet as many use cases as possible.
One additional clarification that I wanted to understand is whether this is actually a multicast message or not. [...]
It is a message with PID and SEQ set to 0
. I'm quite sure that I did not need to subscribe to a multicast group to receive the message if I sent the request myself, but I would have to try again to verify this.
Hi @DerZade, I apologize for the delay. How would you suggest using CMD?
Currently neli sets the PID of the request and then routes responses with the same PID to the receiver returned by send
. For our use case with nl80211 it would be nice if that routing is not done because of the PID, but because of the command. So I would like to receive messages with the same command as I sent.
Arguably this would only be a "good behavior" for usage with nl80211 and not any other netlink api, because it makes a lot of assumptions, i.e. that it is GenNL and not just plain NL.
For our use case we have now spawned an additional thread that receives all multicast messages and then forwards them to different listeners depending on the GenNL command of the message.
@DerZade Sorry for the delay. Can you test #209 and see if it resolves your issue?
Sorry for not replying sooner. I will try to get to it next week, but I can not promise anything 😅.
We're currently experimenting with
nl80211
, which has some weird behavior, which makes it kind of hard to work with theNlRouter
.So nl80211 is (in my opinion) badly designed, as it uses multicast messages, where it should not imho. For example when sending a
NL80211_CMD_CONNECT
request to the kernel, you get an response (also with commandNL80211_CMD_CONNECT
), but as a multicast message (PID = 0). The same is true for some other commands as well.This makes usage with the new
NlRouter
kinda shitty, because the router thinks it is a multicast message (because it sees PID=0) and therefore routes the message to the multicast receiver, instead of the receiver returned by thesend
call. Admittedly, this is not because of how neli is implemented (which is reasonable), but how suboptimally nl80211 was designed.I looked at the neli code and found (at least as far as I can tell) that the router currently uses the PID to route to the correct receiver. Is there any way we could make this work maybe via CMD instead of PID? 🤔