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
Wireless interface name truncated to 16 characters, one more than the 15 characters allowed by the kernel #11259
Comments
That is not a bug, but a well documented -intentional- limit set by the linux kernel. |
@pkgadd I don't think you fully comprehended the bug report. I can see why you responded as you did just by reading the title. So I'm giving it a better title. The bug is not in the kernel, its in OpenWRT not truncating enough characters to satisfy the 15 character interface name limit set by the kernel. |
It's difficult to say how long the ifname is going to get, with |
The option |
Could you test https://git.openwrt.org/02ada7a28b9390625d29aad6308f623df930342a ? |
I'm not setup to test this at the moment (I could test a build with that change, but I'm not setup to build openwrt). But for someone that can easily build OpenWRT, it should be trivial to test x86 build in a VM. |
Should be fixed by 2e61469. |
The `IFNAMSIZ` macro defines the required buffer size to hold a Linux interface name including the terminating zero byte while netifd currently uses an `IFNAMSIZ + 1` limit for interface name buffers. This causes netifd to use overlong names (16 instead of 15 bytes) in netlink communication with the kernel, leading to netlink failure replies due to policy violations. Fix this issue by applying the correct length, that is `IFNAMSIZ` directly, to the corresponding buffers. Ref: openwrt/openwrt#11259 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Currently, if I set a wireless interface to a name with more than 16 characters via
option ifname
of awifi-iface
config block in/etc/config/wireless
the interface will fail to come up. Looking in the logs, I can see that the interface name, "iface678901234567890", is being truncated:This indicated that somewhere (in netifd?) some code is truncating the interface name to 16 bytes. I suspect in an attempt to satisfy the maximum interface length requirement, but is off by 1. The maximum length of an interface name is 15 characters:
The text was updated successfully, but these errors were encountered: