]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: Do not send empty IFLA_AF_SPEC attribute
authorBenjamin Poirier <bpoirier@nvidia.com>
Mon, 25 Jul 2022 00:12:36 +0000 (09:12 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 26 Jul 2022 13:35:53 +0000 (15:35 +0200)
commitb5445f9da1b4d70b74092ae7863fbd3707a2e878
treec4fda61cabd1d8d778a8740342571c0959b4b416
parenta9dbc0a8c27e94f71936af6ea4f1a144347824e4
bridge: Do not send empty IFLA_AF_SPEC attribute

After commit cb8f2435c6ed ("bridge: Netlink interface fix."),
br_fill_ifinfo() started to send an empty IFLA_AF_SPEC attribute when a
bridge vlan dump is requested but an interface does not have any vlans
configured.

iproute2 ignores such an empty attribute since commit b262a9becbcb
("bridge: Fix output with empty vlan lists") but older iproute2 versions as
well as other utilities have their output changed by the cited kernel
commit, resulting in failed test cases. Regardless, emitting an empty
attribute is pointless and inefficient.

Avoid this change by canceling the attribute if no AF_SPEC data was added.

Fixes: cb8f2435c6ed ("bridge: Netlink interface fix.")
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20220725001236.95062-1-bpoirier@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/bridge/br_netlink.c