diff mbox series

[1/3] wired: Update to the new l_netlink_send API

Message ID 20240726223754.159303-1-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [1/3] wired: Update to the new l_netlink_send API | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-alpine-ci-setupell fail Setup ELL - make FAIL: writing RSA key writing RSA key writing RSA key writing RSA key writing RSA key unit/test-rtnl.c: In function 'test_address': unit/test-rtnl.c:282:13: error: offset '2305843009213693948' outside bounds of constant string [-Werror=array-bounds] 282 | static void test_address(const void *data) | ^~~~~~~~~~~~ unit/test-rtnl.c:213:36: note: 'address' declared here 213 | static const struct l_rtnl_address address = { | ^~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2030: unit/test-rtnl.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1307: all] Error 2
prestwoj/iwd-alpine-ci-makedistcheck pending makedistcheck SKIP
prestwoj/iwd-alpine-ci-build pending build SKIP
prestwoj/iwd-alpine-ci-makecheckvalgrind pending makecheckvalgrind SKIP
prestwoj/iwd-alpine-ci-incremental_build pending incremental_build SKIP
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-alpine-ci-makecheck pending makecheck SKIP
prestwoj/iwd-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-ci-incremental_build fail Make FAIL (patch 0): src/netdev.c: In function ‘netdev_get_link’: src/netdev.c:6107:56: error: passing argument 2 of ‘l_netlink_send’ makes pointer from integer without a cast [-Werror=int-conversion] 6107 | netdev->get_link_cmd_id = l_netlink_send(rtnl, RTM_GETLINK, 0, rtmmsg, | ^~~~~~~~~~~ | | | int In file included from ./ell/ell.h:17, from src/netdev.c:40: ./ell/netlink.h:34:59: note: expected ‘struct l_netlink_message *’ but argument is of type ‘int’ 34 | struct l_netlink_message *message, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ src/netdev.c:6108:49: error: passing argument 5 of ‘l_netlink_send’ makes pointer from integer without a cast [-Werror=int-conversion] 6108 | bufsize, netdev_getlink_cb, | ^~~~~~~ | | | size_t {aka long unsigned int} In file included from ./ell/ell.h:17, from src/netdev.c:40: ./ell/netlink.h:37:58: note: expected ‘l_netlink_destroy_func_t’ {aka ‘void (*)(void *)’} but argument is of type ‘size_t’ {aka ‘long unsigned int’} 37 | l_netlink_destroy_func_t destroy); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ src/netdev.c:6107:35: error: too many arguments to function ‘l_netlink_send’ 6107 | netdev->get_link_cmd_id = l_netlink_send(rtnl, RTM_GETLINK, 0, rtmmsg, | ^~~~~~~~~~~~~~ In file included from ./ell/ell.h:17, from src/netdev.c:40: ./ell/netlink.h:33:14: note: declared here 33 | unsigned int l_netlink_send(struct l_netlink *netlink, | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2578: src/netdev.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1741: all] Error 2
prestwoj/iwd-ci-testrunner pending testrunner SKIP
prestwoj/iwd-ci-makecheck pending makecheck SKIP
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS

Commit Message

Denis Kenzior July 26, 2024, 10:37 p.m. UTC
---
 wired/ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

James Prestwood July 29, 2024, 11:41 a.m. UTC | #1
On 7/26/24 3:37 PM, Denis Kenzior wrote:
> ---
>   wired/ethdev.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
>
All look good to me
Denis Kenzior July 30, 2024, 3:53 p.m. UTC | #2
On 7/26/24 5:37 PM, Denis Kenzior wrote:
> ---
>   wired/ethdev.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 

All applied
diff mbox series

Patch

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;
 }