3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

netdev: Update to the new l_netlink_send API

This commit is contained in:
Denis Kenzior 2024-07-26 17:32:24 -05:00
parent d7f669dd7c
commit e33fa63243

View File

@ -6093,23 +6093,19 @@ error:
static void netdev_get_link(struct netdev *netdev) static void netdev_get_link(struct netdev *netdev)
{ {
struct ifinfomsg *rtmmsg; struct ifinfomsg ifi;
size_t bufsize; struct l_netlink_message *nlm =
l_netlink_message_new_sized(RTM_GETLINK, 0, sizeof(ifi));
/* Query interface flags */ memset(&ifi, 0, sizeof(ifi));
bufsize = NLMSG_ALIGN(sizeof(struct ifinfomsg)); ifi.ifi_family = AF_UNSPEC;
rtmmsg = l_malloc(bufsize); ifi.ifi_index = netdev->index;
memset(rtmmsg, 0, bufsize);
rtmmsg->ifi_family = AF_UNSPEC; l_netlink_message_add_header(nlm, &ifi, sizeof(ifi));
rtmmsg->ifi_index = netdev->index;
netdev->get_link_cmd_id = l_netlink_send(rtnl, RTM_GETLINK, 0, rtmmsg, netdev->get_link_cmd_id = l_netlink_send(rtnl, nlm, netdev_getlink_cb,
bufsize, netdev_getlink_cb,
netdev, NULL); netdev, NULL);
L_WARN_ON(netdev->get_link_cmd_id == 0); L_WARN_ON(netdev->get_link_cmd_id == 0);
l_free(rtmmsg);
} }
struct netdev *netdev_create_from_genl(struct l_genl_msg *msg, struct netdev *netdev_create_from_genl(struct l_genl_msg *msg,