Closed a-gavin closed 4 months ago
Hi @a-gavin, I think the best way to handle the fact that the payload field is required in NlAttr
is to pass in the empty type (()
) as the payload. This will result in an empty payload.
Why didn't I think of that? haha. I'll give that a try. Thanks!
Sure thing! Closing, but feel free to comment if that doesn't resolve your issue.
This fixed my issue. Thanks for the quick help!
I am currently looking for a way to pass empty data in a
Nlattr
payload, but I'm stumped and likely running into my limits of Rust knowledge.Below is a packet capture on a Netlink monitor interface comparing the
NL80211_CMD_GET_WIPHY
command ofiw phy0 info
with that of example neli code in this gist (using neli v0.7.0-rc2). On the left isiw
command netlink command with the emptyNL80211_ATTR_SPLIT_WIPHY_DUMP
attribute. On the right is the non-empty attribute as generated by the neli example code I linked.For others looking to do the same, the command I run the following commands to create and up a Netlink monitor interface
nlmon0
on Linux:I'd be happy to contribute this to the
nl80211.rs
example, including more interestingNL80211_CMD_GET_WIPHY
output, once I figure out how to do so as it's a task I'm already working on.