Wireless Daemon for Linux
 help / color / mirror / Atom feed
* Re: [PATCH 3/8] netconfig: Set netconfig_get_static6_gateway out param on success
@ 2021-09-29 20:17 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-09-29 20:17 UTC (permalink / raw)
  To: iwd 

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

Hi Andrew,

On 9/24/21 8:11 PM, Andrew Zaborowski wrote:
> Make sure to only set the netconfig_get_static6_gateway's out_mac
> parameter on successful return and make sure to always set it, even if
> to NULL.
> ---
>   src/netconfig.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 3/8] netconfig: Set netconfig_get_static6_gateway out param on success
@ 2021-09-25  1:11 Andrew Zaborowski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Zaborowski @ 2021-09-25  1:11 UTC (permalink / raw)
  To: iwd 

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

Make sure to only set the netconfig_get_static6_gateway's out_mac
parameter on successful return and make sure to always set it, even if
to NULL.
---
 src/netconfig.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/netconfig.c b/src/netconfig.c
index 493a5c13..30e56157 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -498,6 +498,7 @@ static struct l_rtnl_route *netconfig_get_static6_gateway(
 {
 	L_AUTO_FREE_VAR(char *, gateway);
 	struct l_rtnl_route *ret;
+	const uint8_t *mac = NULL;
 
 	gateway = l_settings_get_string(netconfig->active_settings,
 						"IPv6", "Gateway");
@@ -509,7 +510,7 @@ static struct l_rtnl_route *netconfig_get_static6_gateway(
 					netconfig->fils_override->ipv6_gateway);
 
 		if (!l_memeqzero(netconfig->fils_override->ipv6_gateway_mac, 6))
-			*out_mac = netconfig->fils_override->ipv6_gateway_mac;
+			mac = netconfig->fils_override->ipv6_gateway_mac;
 	} else if (!gateway)
 		return NULL;
 
@@ -523,6 +524,7 @@ static struct l_rtnl_route *netconfig_get_static6_gateway(
 
 	l_rtnl_route_set_priority(ret, ROUTE_PRIORITY_OFFSET);
 	l_rtnl_route_set_protocol(ret, RTPROT_STATIC);
+	*out_mac = mac;
 
 	return ret;
 }
@@ -864,7 +866,7 @@ static void netconfig_ipv6_ifaddr_add_cmd_cb(int error, uint16_t type,
 {
 	struct netconfig *netconfig = user_data;
 	struct l_rtnl_route *gateway;
-	const uint8_t *gateway_mac = NULL;
+	const uint8_t *gateway_mac;
 
 	netconfig->addr6_add_cmd_id = 0;
 
-- 
2.30.2

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

end of thread, other threads:[~2021-09-29 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-29 20:17 [PATCH 3/8] netconfig: Set netconfig_get_static6_gateway out param on success Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2021-09-25  1:11 Andrew Zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox