Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host-device cannot use linux wireless devices #957

Open
rfenlon opened this issue Oct 16, 2023 · 1 comment
Open

host-device cannot use linux wireless devices #957

rfenlon opened this issue Oct 16, 2023 · 1 comment
Labels
bug help wanted low-hanging-fruit Easy issues, and good first issues.

Comments

@rfenlon
Copy link

rfenlon commented Oct 16, 2023

When configured to use a wireless device (e.g. wlo1) host-device fails to change the network namespace with an invalid argument response (see netlink/link_linux.go:922). Consider conditionally doing the equivalent of iw phy <my-phy> set netns name <my-namespace> when it's a wireless device.

@squeed squeed added bug help wanted low-hanging-fruit Easy issues, and good first issues. labels Oct 18, 2023
@rfenlon
Copy link
Author

rfenlon commented Oct 19, 2023

I dug into this a little bit and found that the linux vendor dependency github.com/vishvananda/netlink does not support sending nl80211 messages to netlink. Here is an example of a working netlink request message to change the namespace of a phy using file descriptor for the new network namespace :

-------------------------- BEGIN NETLINK MESSAGE ---------------------------
[NETLINK HEADER] 16 octets
.nlmsg_len = 36
.type = 32 <0x20>
.flags = 5 <REQUEST,ACK>
.seq = 1697642139
.port = -2016371064
[GENERIC NETLINK HEADER] 4 octets
.cmd = 49 <NL80211_CMD_SET_WIPHY_NETNS>
.version = 0
.unused = 0
[PAYLOAD] 16 octets
08 00 01 00 01 00 00 00 08 00 db 00 04 00 00 00 ................ <NL80211_ATTR_WIPHY 0x01> and <NL80211_ATTR_NETNS_FD 0xdb>
--------------------------- END NETLINK MESSAGE ---------------------------

I'm not a kernel developer so I'm having trouble finding the following:

  • netlink header type = 32 // unknown what Generic Netlink Family ID is tied to 32
  • payload // I know 2 octets = NL80211_ATTR_WIPHY, 4 octets = device index, 2 octets = NL80211_ATTR_NETNS_FD, 4 octets = file descriptor. I don't know what the remaining 4 octets are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted low-hanging-fruit Easy issues, and good first issues.
Projects
None yet
Development

No branches or pull requests

2 participants