All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netdev: update use of l_rtnl_set_mac
@ 2020-03-11 22:52 James Prestwood
  2020-03-12 15:47 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2020-03-11 22:52 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]

This API was updated to take an extra boolean which will
automatically power up the device while changing the MAC
address. Since this is what IWD does anyways we can avoid
the need for an intermediate callback and go right into
netdev_initial_up_cb.
---
 src/netdev.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/src/netdev.c b/src/netdev.c
index 846f7b07..35f2d7f0 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -4137,20 +4137,6 @@ static void netdev_initial_up_cb(int error, uint16_t type, const void *data,
 	netdev->events_ready = true;
 }
 
-static void netdev_set_mac_cb(int error, uint16_t type, const void *data,
-					uint32_t len, void *user_data)
-{
-	struct netdev *netdev = user_data;
-
-	if (error)
-		l_error("Error setting mac address on %d: %s", netdev->index,
-			strerror(-error));
-
-	netdev->set_powered_cmd_id =
-		l_rtnl_set_powered(rtnl, netdev->index, true,
-					netdev_initial_up_cb, netdev, NULL);
-}
-
 static bool netdev_check_set_mac(struct netdev *netdev)
 {
 	if (util_mem_is_zero(netdev->set_mac_once, 6))
@@ -4159,8 +4145,8 @@ static bool netdev_check_set_mac(struct netdev *netdev)
 	l_debug("Setting initial address on ifindex: %d to: " MAC,
 		netdev->index, MAC_STR(netdev->set_mac_once));
 	netdev->set_powered_cmd_id =
-		l_rtnl_set_mac(rtnl, netdev->index, netdev->set_mac_once,
-				netdev_set_mac_cb, netdev, NULL);
+		l_rtnl_set_mac(rtnl, netdev->index, netdev->set_mac_once, true,
+				netdev_initial_up_cb, netdev, NULL);
 	memset(netdev->set_mac_once, 0, 6);
 	return true;
 }
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netdev: update use of l_rtnl_set_mac
  2020-03-11 22:52 [PATCH] netdev: update use of l_rtnl_set_mac James Prestwood
@ 2020-03-12 15:47 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-03-12 15:47 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

Hi James,

On 3/11/20 5:52 PM, James Prestwood wrote:
> This API was updated to take an extra boolean which will
> automatically power up the device while changing the MAC
> address. Since this is what IWD does anyways we can avoid
> the need for an intermediate callback and go right into
> netdev_initial_up_cb.
> ---
>   src/netdev.c | 18 ++----------------
>   1 file changed, 2 insertions(+), 16 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-12 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 22:52 [PATCH] netdev: update use of l_rtnl_set_mac James Prestwood
2020-03-12 15:47 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.