diff mbox series

[43/90] inet: Include interface index and name in 'DBG'.

Message ID 20231206235056.322578-47-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Add Gateway Low-priority Default Routes for Non-default Services | expand

Commit Message

Grant Erickson Dec. 6, 2023, 11:50 p.m. UTC
From: Grant Erickson <erick205@umn.edu>

This includes both the network interface index and name in the 'DBG'
statement in 'iproute_default_modify' to aid in debugging.
---
 src/inet.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/inet.c b/src/inet.c
index e135d1ad3cae..9d5841fdf2e3 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -3204,8 +3204,12 @@  static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
 	int ret, len;
 	int family = connman_inet_check_ipaddress(gateway);
 	char *dst = NULL;
+	g_autofree char *interface = NULL;
 
-	DBG("gateway %s/%u table %u <%s>",
+	interface = connman_inet_ifname(ifindex);
+
+	DBG("ifindex %d (%s) gateway %s/%u table %u <%s>",
+		ifindex, interface,
 		gateway, prefixlen,
 		table_id, __connman_inet_table2string(table_id));