sd-netlink: add generic netlink support

This also adds the ability to incorporate arrays into netlink messages
and to determine when a netlink message is too big, used by some generic
netlink protocols.
This commit is contained in:
Jörg Thalheim
2018-01-09 14:00:49 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 8481e3e71e
commit 05d0c2e3cf
15 changed files with 299 additions and 28 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ static void netdev_cancel_callbacks(NetDev *netdev) {
if (!netdev)
return;
rtnl_message_new_synthetic_error(-ENODEV, 0, &m);
rtnl_message_new_synthetic_error(netdev->manager->rtnl, -ENODEV, 0, &m);
while ((callback = netdev->callbacks)) {
if (m) {
@@ -322,7 +322,7 @@ int netdev_enslave(NetDev *netdev, Link *link, sd_netlink_message_handler_t call
} else if (IN_SET(netdev->state, NETDEV_STATE_LINGER, NETDEV_STATE_FAILED)) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
r = rtnl_message_new_synthetic_error(-ENODEV, 0, &m);
r = rtnl_message_new_synthetic_error(netdev->manager->rtnl, -ENODEV, 0, &m);
if (r >= 0)
callback(netdev->manager->rtnl, m, link);
} else {