OSDN Git Service

netlink: factor out extack composition
authorJakub Kicinski <kuba@kernel.org>
Fri, 26 Aug 2022 03:09:30 +0000 (20:09 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Aug 2022 10:20:43 +0000 (12:20 +0200)
commit0c95cea24f30eb28d464c593d8fbd64cd305791b
tree05a577e14b355a97f8b42fba0d5dcb48760a06b4
parent47cf88993c910840d565631ad906abdca9168231
netlink: factor out extack composition

The ext_ack writing code looks very "organically grown".
Move the calculation of the size and writing out to helpers.
This is more idiomatic and gives us the ability to return early
avoiding the long (and randomly ordered) "if" conditions.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/netlink/af_netlink.c