]> git.proxmox.com Git - mirror_iproute2.git/commit - lib/libnetlink.c
devlink: mnlg: Catch returned error value of dumpit commands
authorMoshe Shemesh <moshe@mellanox.com>
Tue, 11 Jun 2019 16:11:09 +0000 (19:11 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 12 Jun 2019 15:43:14 +0000 (08:43 -0700)
commitc934da8aaacb015e08ac8abbbd0aa696a7ef19fd
tree77b5c841daaad98b12a94ede1949e060d32f215f
parentba126dcad20e6d0e472586541d78bdd1ac4f1123
devlink: mnlg: Catch returned error value of dumpit commands

Devlink commands which implements the dumpit callback may return error.
The netlink function netlink_dump() sends the errno value as the payload
of the message, while answering user space with NLMSG_DONE.
To enable receiving errno value for dumpit commands we have to check for
it in the message. If it is a negative value then the dump returned an
error so we should set errno accordingly and check for ext_ack in case
it was set.

Fixes: 049c58539f5d ("devlink: mnlg: Add support for extended ack")
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/mnlg.c
include/libnetlink.h
lib/libnetlink.c