diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-11-17 09:09:09 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-11-17 09:13:49 +0100 |
commit | 2cffe0c44e62b9e063fa30ce07431753494c53c2 (patch) | |
tree | 4f9977485780402f699ddeb95e76ea6654b684fb /iprule.h | |
parent | 76d2d41b7355e02f95fbfa79affbd232fb090595 (diff) | |
download | netifd-2cffe0c44e62b9e063fa30ce07431753494c53c2.tar.gz |
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>
Diffstat (limited to 'iprule.h')
-rw-r--r-- | iprule.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -77,8 +77,8 @@ struct iprule { struct interface_user out_iface_user; /* device name */ - char in_dev[IFNAMSIZ + 1]; - char out_dev[IFNAMSIZ + 1]; + char in_dev[IFNAMSIZ]; + char out_dev[IFNAMSIZ]; /* everything below is used as avl tree key */ /* don't change the order */ |