public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 1/3] wired: Update to the new l_netlink_send API
Date: Fri, 26 Jul 2024 17:37:43 -0500	[thread overview]
Message-ID: <20240726223754.159303-1-denkenz@gmail.com> (raw)

---
 wired/ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/wired/ethdev.c b/wired/ethdev.c
index e5353582494e..a933cc18e343 100644
--- a/wired/ethdev.c
+++ b/wired/ethdev.c
@@ -723,7 +723,8 @@ static void setup_adapter_interface(struct l_dbus_interface *interface)
 
 bool ethdev_init(const char *whitelist, const char *blacklist)
 {
-	struct ifinfomsg msg;
+	struct ifinfomsg ifi;
+	struct l_netlink_message *nlm;
 
 	if (rtnl)
 		return false;
@@ -760,10 +761,11 @@ bool ethdev_init(const char *whitelist, const char *blacklist)
 	if (blacklist)
 		blacklist_filter = l_strsplit(blacklist, ',');
 
-	memset(&msg, 0, sizeof(msg));
+	memset(&ifi, 0, sizeof(ifi));
+	nlm = l_netlink_message_new_sized(RTM_GETLINK, NLM_F_DUMP, sizeof(ifi));
+	l_netlink_message_add_header(nlm, &ifi, sizeof(ifi));
 
-	l_netlink_send(rtnl, RTM_GETLINK, NLM_F_DUMP, &msg, sizeof(msg),
-						getlink_callback, NULL, NULL);
+	l_netlink_send(rtnl, nlm, getlink_callback, NULL, NULL);
 
 	return true;
 }
-- 
2.45.2


             reply	other threads:[~2024-07-26 22:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26 22:37 Denis Kenzior [this message]
2024-07-26 22:37 ` [PATCH 2/3] netdev: Update to the new l_netlink_send API Denis Kenzior
2024-07-26 22:37 ` [PATCH 3/3] monitor: Update to the new ell " Denis Kenzior
2024-07-29 11:41 ` [PATCH 1/3] wired: Update to the new " James Prestwood
2024-07-30 15:53 ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240726223754.159303-1-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox