]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - net/batman-adv/bat_iv_ogm.c
batman-adv: Always send iface index+name in genlmsg
authorSven Eckelmann <sven@narfation.org>
Mon, 10 May 2021 13:05:42 +0000 (15:05 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Mon, 17 May 2021 10:00:44 +0000 (12:00 +0200)
commitd295345abb3e91e5a16f3293eb12b111e352bd2b
tree096e4a878336ee7c20d5abbbd9ca7f6cab0b80ca
parent9a959cab22194d633b3a1d9d1943b0df3475122c
batman-adv: Always send iface index+name in genlmsg

The batman-adv netlink messages often contain the interface index and
interface name in the same message. This makes it easy for the receiver to
operate on the incoming data when it either needs to print something or
needs to operate on the interface index.

But one of the attributes was missing for:

* neighbor table dumps
* originator table dumps
* gateway list dumps
* query of hardif information
* query of vid information

The userspace therefore had to implement special workarounds using
SIOCGIFNAME or SIOCGIFINDEX depending on what was actually provided.
Providing both information simplifies the userspace code massively without
adding a lot of extra overhead in the kernel portion.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bat_v.c
net/batman-adv/netlink.c