diff mbox series

[1/3] connection: Rename 'disable_gateway'.

Message ID 20231129062109.1270106-2-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Rename 'disable_gateway' and 'del_routes' | expand

Commit Message

Grant Erickson Nov. 29, 2023, 6:21 a.m. UTC
This renames 'disable_gateway' as 'del_gateway_routes_if_active'. The
former is a bit of a misnomer since it is not possible to actually
"disable" a gateway and its associated routes. The latter, revised
name more accurately reflect its purpose and conditional action.
---
 src/connection.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/src/connection.c b/src/connection.c
index c39b861708fb..547a47cf8b6f 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -621,7 +621,7 @@  static int del_routes(struct gateway_data *data,
 	return (status4 < 0 ? status4 : status6);
 }
 
-static int disable_gateway(struct gateway_data *data,
+static int del_gateway_routes_if_active(struct gateway_data *data,
 			enum connman_ipconfig_type type)
 {
 	bool active = false;
@@ -695,7 +695,7 @@  static int disable_gateway(struct gateway_data *data,
  *                    #gateway_config.
  *
  *  @sa __connman_connection_gateway_add
- *  @sa disable_gateway
+ *  @sa del_gateway_routes_if_active
  *
  */
 static int add_gateway(struct connman_service *service,
@@ -753,7 +753,7 @@  static int add_gateway(struct connman_service *service,
 	if (old) {
 		DBG("Replacing gw %p ipv4 %p ipv6 %p", old,
 			old->ipv4_config, old->ipv6_config);
-		disable_gateway(old, type);
+		del_gateway_routes_if_active(old, type);
 		if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
 			temp_data->ipv6_config = old->ipv6_config;
 			old->ipv6_config = NULL;
@@ -1463,7 +1463,7 @@  void __connman_connection_gateway_remove(struct connman_service *service,
 
 	/* Remove all active routes associated with this gateway data. */
 
-	err = disable_gateway(data, type);
+	err = del_gateway_routes_if_active(data, type);
 
 	/*
 	 * We remove the service from the service/gateway map only if ALL
@@ -1660,7 +1660,7 @@  void __connman_connection_cleanup(void)
 	while (g_hash_table_iter_next(&iter, &key, &value)) {
 		struct gateway_data *data = value;
 
-		disable_gateway(data, CONNMAN_IPCONFIG_TYPE_ALL);
+		del_gateway_routes_if_active(data, CONNMAN_IPCONFIG_TYPE_ALL);
 	}
 
 	g_hash_table_destroy(gateway_hash);