treewide: correctly apply IFNAMSIZ limit
authorJo-Philipp Wich <jo@mein.io>
Thu, 17 Nov 2022 08:09:09 +0000 (09:09 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 17 Nov 2022 08:13:49 +0000 (09:13 +0100)
commit2cffe0c44e62b9e063fa30ce07431753494c53c2
tree4f9977485780402f699ddeb95e76ea6654b684fb
parent76d2d41b7355e02f95fbfa79affbd232fb090595
treewide: correctly apply IFNAMSIZ limit

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: https://github.com/openwrt/openwrt/issues/11259
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
device.h
iprule.h
system-linux.c
vlan.c