diff mbox series

[v2,26/60] service: Capture IP configuration state by value rather than by pointer.

Message ID 20231221064007.2347566-27-gerickson@nuovations.com (mailing list archive)
State Superseded
Headers show
Series Complete 'continuous' Online Check Mode Implementation. | expand

Commit Message

Grant Erickson Dec. 21, 2023, 6:39 a.m. UTC
With recent refactoring, there is no longer any need to capture the IP
configuration state by pointer in 'complete_online_check'. Instead,
capture it by value.
---
 src/service.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/src/service.c b/src/service.c
index a51c1685b308..2017370d7ce8 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2464,11 +2464,12 @@  static bool handle_online_check_failure(struct connman_service *service,
 {
 	bool reschedule = false;
 
-	DBG("service %p (%s) type %d (%s) "
+	DBG("service %p (%s) type %d (%s) state %d (%s) "
 		"one-shot %u err %d (%s)\n",
 		service,
 		connman_service_get_identifier(service),
 		type, __connman_ipconfig_type2string(type),
+		ipconfig_state, state2string(ipconfig_state),
 		oneshot, err, strerror(-err));
 
 	/*
@@ -2550,7 +2551,7 @@  static void complete_online_check(struct connman_service *service,
 					int err)
 {
 	struct online_check_state *online_check_state;
-	enum connman_service_state *ipconfig_state;
+	enum connman_service_state ipconfig_state;
 	bool reschedule = false;
 
 	DBG("service %p (%s) type %d (%s) "
@@ -2562,10 +2563,10 @@  static void complete_online_check(struct connman_service *service,
 
 	if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
 		online_check_state = &service->online_check_state_ipv4;
-		ipconfig_state = &service->state_ipv4;
+		ipconfig_state = service->state_ipv4;
 	} else if (type == CONNMAN_IPCONFIG_TYPE_IPV6) {
 		online_check_state = &service->online_check_state_ipv6;
-		ipconfig_state = &service->state_ipv6;
+		ipconfig_state = service->state_ipv6;
 	} else
 		return;
 
@@ -2577,7 +2578,7 @@  static void complete_online_check(struct connman_service *service,
 	else
 		reschedule = handle_online_check_failure(service,
 					 type,
-					 *ipconfig_state,
+					 ipconfig_state,
 					 online_check_state,
 					 !enable_online_to_ready_transition,
 					 err);