ConnMan network manager
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH] wispr: Make 'wispr_route_request' route add 'DBG' consistent.
Date: Tue, 19 Dec 2023 17:41:18 -0800	[thread overview]
Message-ID: <20231220014118.2265388-1-gerickson@nuovations.com> (raw)

This makes the route addition 'DBG' in 'wispr_route_request'
consistent with the route deletion 'DBG' in 'free_wispr_route'.
---
 src/wispr.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/wispr.c b/src/wispr.c
index efc0ca2fbaa9..b1b0f337d3f8 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -690,24 +690,19 @@ static bool wispr_route_request(const char *address, int ai_family,
 {
 	int result = -1;
 	struct connman_wispr_portal_context *wp_context = user_data;
+	g_autofree char *interface = NULL;
 	const char *gateway;
 	struct wispr_route *route;
 	uint32_t metric = 0;
 
+	interface = connman_inet_ifname(if_index);
+
 	gateway = __connman_ipconfig_get_gateway_from_index(if_index,
 		wp_context->type);
 
-	DBG("address %s if %d gw %s", address, if_index, gateway);
-
 	if (!gateway)
 		return false;
 
-	route = g_try_new0(struct wispr_route, 1);
-	if (route == 0) {
-		DBG("could not create struct");
-		return false;
-	}
-
 	result = __connman_service_get_route_metric(wp_context->service,
 				&metric);
 	if (result < 0) {
@@ -719,10 +714,21 @@ static bool wispr_route_request(const char *address, int ai_family,
 		return false;
 	}
 
-	DBG("service %p (%s) metric %u",
-		wp_context->service,
-		connman_service_get_identifier(wp_context->service),
-		metric);
+	DBG("add route to %s via %s dev %d (%s) metric %u type %d (%s) "
+		"ops %p",
+		address,
+		gateway,
+		if_index, interface,
+		metric,
+		wp_context->type,
+		__connman_ipconfig_type2string(wp_context->type),
+		wp_context->ops);
+
+	route = g_try_new0(struct wispr_route, 1);
+	if (route == 0) {
+		DBG("could not create struct");
+		return false;
+	}
 
 	result = wp_context->ops->add_host_route_with_metric(
 					if_index,
-- 
2.42.0


             reply	other threads:[~2023-12-20  1:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  1:41 Grant Erickson [this message]
2023-12-23 12:21 ` [PATCH] wispr: Make 'wispr_route_request' route add 'DBG' consistent Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231220014118.2265388-1-gerickson@nuovations.com \
    --to=gerickson@nuovations.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).