diff mbox series

[1/8] inet: Relocate 'rtnl_route_cmd2string'.

Message ID 20231215001032.2127527-2-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series inet: Add IPv{4,6} Host/Network Route Add/Delete with Metric / Priority Functions | expand

Commit Message

Grant Erickson Dec. 15, 2023, 12:10 a.m. UTC
This relocates the 'rtnl_route_cmd2string' function earlier in the
file to accommodate incorporation by other functions later in the file
without the need for a forward declration.
---
 src/inet.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/src/inet.c b/src/inet.c
index e957212f11e8..ad2bca7a5e04 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -584,6 +584,18 @@  int connman_inet_clear_address(int index, struct connman_ipaddress *ipaddress)
 	return 0;
 }
 
+static const char *rtnl_route_cmd2string(int cmd)
+{
+	switch (cmd) {
+	case RTM_NEWROUTE:
+		return "add";
+	case RTM_DELROUTE:
+		return "del";
+	}
+
+	return "";
+}
+
 int connman_inet_add_host_route(int index, const char *host,
 				const char *gateway)
 {
@@ -3255,18 +3267,6 @@  int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmar
 	return iprule_modify(RTM_DELRULE, family, table_id, fwmark);
 }
 
-static const char *rtnl_route_cmd2string(int cmd)
-{
-	switch (cmd) {
-	case RTM_NEWROUTE:
-		return "add";
-	case RTM_DELROUTE:
-		return "del";
-	}
-
-	return "";
-}
-
 /**
  *  @brief
  *    Add or remove a gateway default route.