From patchwork Thu Dec 12 05:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904685 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A93D748A for ; Thu, 12 Dec 2024 05:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; cv=none; b=PZdW8adJn7koHLSEJ3VrJNzYNJkQaZcManE/4tJ/ulYbiCX3XlrSN9wEuUrGsLW+M1UA4flbld9y7vqpoOxXhilf+DZttnac5y5FPoZ5a8E4L2O83tU55cIZ5EO8VAbFcN5nrQW+2ox7h+0lDuTgDdN9ZoNxWTmEHCdT2OMjjRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; c=relaxed/simple; bh=cHPl4D49YzgjiTPpg6VKrOtLuziez6x9dstG2MRoNaM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rhjsMKiE4gWNaYgrfreMcR1BH6lDdnhGdKntTrYFIi+zgArKcF3ztoxC5Oc5lWpuX4Y+wgpgijzu69UTIXcZv68y/QHvHyYoyg4hgJVPJwoA3AVW5Mj5Gak6+m8i791lrHkC6vXS/VzYEzXqbROUKsoDf6Hf3i7P4CkiOQFVo6U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=UeDjo+mc; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="UeDjo+mc" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 345DF1649BA for ; Thu, 12 Dec 2024 00:28:19 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id DD83B124FD0 for ; Thu, 12 Dec 2024 00:28:18 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 01/15] service: Add 'service_log_pac' function. Date: Wed, 11 Dec 2024 21:28:03 -0800 Message-ID: <20241212052817.2021264-2-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=9fe+bQ1COG98YkRJbgrD9E5NKklRxJhPfW8htohn3jE=; b=UeDjo+mcNzfQeVCZlzcGpdfgrGUMTkSXrp1+6QeGGAcA4xp7DIYKD0DM/B8v6P+gcy8xyl0f0V2wVkOab8Pv4k9q7gSX3y4nK+CMPFWEA4lCcWH1mMcJxbPtNBdao3U8cmNmyi2gYssSHEIEndE6ATkmdVtT3tVtKBwow6L+rOL5JfSf2E9MBIrXtl2JoBoYITfV2H6FTMqEnwdHT0zT1MYsaAtKIwNtOPR6z654nFDRUNnzl4Dvlnb+nuYxq5FSVDcuTKolcEV53RIuqxY0YQad8VhmLnjzVIeSpVcIZCewbdzF9iz6KL863Tru6rWLG4YC+bmZsGARRcYE5FgqgQ== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Logs the network service interface name and type at the info level when the proxy auto-configuration (PAC) URL is set or cleared. Frequently, a spurious, misconfigured, or otherwise incorrect PAC URL is the source of connectivity problems, particularly for online reachability checks. --- src/service.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/service.c b/src/service.c index 805cfca7ad12..0ab299e8ecbf 100644 --- a/src/service.c +++ b/src/service.c @@ -555,6 +555,19 @@ int __connman_service_load_modifiable(struct connman_service *service) return 0; } +static void service_log_pac(const struct connman_service *service, + const char *url) +{ + g_autofree char *interface = NULL; + + interface = connman_service_get_interface(service); + + connman_info("Interface %s [ %s ] proxy auto-configuration (PAC) URL %s.", + interface, + __connman_service_type2string(service->type), + url ? url : "is not set"); +} + static int service_load(struct connman_service *service) { GKeyFile *keyfile; From patchwork Thu Dec 12 05:28:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904688 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 674EA1632D3 for ; Thu, 12 Dec 2024 05:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; cv=none; b=tF2TWARSYwjh+64EdrvPyMe8vovk9QRRneagXB+R5Rt0znwiiCIVp4fVQlQmzw6AZcThjmS/8tOTNsSLFyD7dswhc7/OPF6ORPuKjwjSdghaLoAU1YvkGmO2LGq7yVAsIrqpq2zBqvbKleC7AkjLEWRSf89xWk30Br7Iw2k/q58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; c=relaxed/simple; bh=gcQDwiNlApbr8vuxA1f8McIOwK/VHDf09k5bLSWTn2A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hiFgY7ApQJ+KIqlxDfDWgn9ls1VcAwV0j31FeLryM5Kht5UOT42aqeB5WtfpI5IDFG2sXEg5SjUWx671HQOUay+mZ5Q0TfH+fjFbu8d89uEVJFTy9Iok2fEYxTGlsXlEpGzzlta8+HkcMIna8LeSsdbsdE8pPYFUueuEYp7zzs4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=fwEnmIZd; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="fwEnmIZd" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id C43DA1649C1 for ; Thu, 12 Dec 2024 00:28:19 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 58E63124FD0 for ; Thu, 12 Dec 2024 00:28:19 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 02/15] service: Add 'service_set_pac' function. Date: Wed, 11 Dec 2024 21:28:04 -0800 Message-ID: <20241212052817.2021264-3-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=swBuVsbs5tHoForVMqgAD0nWLf1VIoj6qXtKjx3EY2w=; b=fwEnmIZdEcZhwuaNFckHaGBpnw+sd33jbsODzouAXqqilxOo7eA9GcqBMJhJI4VepDNQHy8dpO1Jnt9+m+t6qf8jeqbfulcWhquStLc2FZ48fpboSTh757CnMccjJ+Ul+w6KOJSUHg71QMLNb1xdcZDmKUuljOWhGjd8DM4jQtfXkZEGIvrVQAjILGyRxN3VUJ9dSBPjr/2qqJtKhENLDixjMDPn7YdoWCPb82nDAUrw7B3BrtRLjExPHNTyv6kqwN+yWvNsfA/IeHC/ibDUswe2Z9147bJyjqNHxWDG7DEgccc5IfAmIRMC2hTr63gP1fKj2ZtFYrplYx65PPQlIg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Allows for logging, setting, and dispatching property changed notifications from a single place. --- src/service.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/service.c b/src/service.c index 0ab299e8ecbf..c48959a7940f 100644 --- a/src/service.c +++ b/src/service.c @@ -233,6 +233,7 @@ static struct connman_ipconfig *create_ip4config(struct connman_service *service static struct connman_ipconfig *create_ip6config(struct connman_service *service, int index); static void dns_changed(struct connman_service *service); +static void proxy_changed(struct connman_service *service); static void vpn_auto_connect(void); static void trigger_autoconnect(struct connman_service *service); static void service_list_sort(const char *function); @@ -568,6 +569,32 @@ static void service_log_pac(const struct connman_service *service, url ? url : "is not set"); } +static void service_set_pac(struct connman_service *service, + const char *pac, + bool dochanged) +{ + DBG("service %p (%s) pac %p (%s) dochanged %u", + service, connman_service_get_identifier(service), + pac, + pac ? pac : "", + dochanged); + + if (service->hidden) + return; + + service_log_pac(service, pac); + + g_free(service->pac); + + if (pac && strlen(pac) > 0) + service->pac = g_strstrip(g_strdup(pac)); + else + service->pac = NULL; + + if (dochanged) + proxy_changed(service); +} + static int service_load(struct connman_service *service) { GKeyFile *keyfile; From patchwork Thu Dec 12 05:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904686 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6749C15B0FE for ; Thu, 12 Dec 2024 05:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; cv=none; b=rZqAiSoeIfcKTUsvxxm6fJ2sTLE1CskFFMyom2HXbSzi1JDFrtne2PQyKgAaPtXqUm0VUJ6sUxsw7CJhI3hXZw0Lif7Or9D5jUB5KhwaUQMwT/OWU0Xp+ofpxYLwVBepcS7WjdQq0rci+LLSD8jXdP8OWcq+3tDf12tem6EYjYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; c=relaxed/simple; bh=lpkz8G+VeIvhVSq+BOerm+WjhYTlK+xE7g1I9BuSyXo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EGMmknPrA63gI2ZdgL85Muj9yJyMe6AsgpuUxkObQCtmMNVVzRAdNMotQTDVcI2dO2DQW63LFJzHdLpECYx6UWju81/fTNoNq8153uRjR38j1oHPW22+VEMxLNs1iGbtI1PVHKbg4sJ2qjUxSy6xGIQGzB6xDPJZUv0M/xiFhCU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=Fc42NaIO; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="Fc42NaIO" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 3FF4F164A14 for ; Thu, 12 Dec 2024 00:28:20 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id E9451124FD2 for ; Thu, 12 Dec 2024 00:28:19 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 03/15] service: Leverage 'service_set_pac' function. Date: Wed, 11 Dec 2024 21:28:05 -0800 Message-ID: <20241212052817.2021264-4-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=4KcKIeLC8PGZeFuYHxLDiBLjQPEdErP6uwgbGjAfD5s=; b=Fc42NaIOqbR0JdOadvMjuQLHnVBbvm+8P0EsluaRa7uJcf9iZ+n/doIyM+n2gtgmSAw4qBitP0IGtly5XKrK96aPhejfLAvegKm0FysLFdukbP0rAawBjlCg6IFWOwCTwJ/OfeTWgptIcuBh87CIaroACjpYvEjIMM8lCozU5EOx0qFSDclNIkeUFk/j4zXzcycZnLpWOIptPkg6/yQFYkJJaZiwg/5AWBWEJokS1B+/xKV9xzaTNe5RMP6bgArm0KF9gDYpMX24evAS5pRfph93wtKZnu3YCRAg2g9UwyTlGaoL9pLqej+4XVp8yRk8RWL1vAomBMciROwh7ECSYg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Leverage 'service_set_pac' at the three call sites the proxy auto-configuration (PAC) URL is currently set or cleared for a network service. Frequently, a spurious, misconfigured, or otherwise incorrect PAC URL is the source of connectivity problems, particularly for online reachability checks. Consequently, being able to log all such mutations can be helpful in triaging such problems. --- src/service.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/service.c b/src/service.c index c48959a7940f..da851d681bc7 100644 --- a/src/service.c +++ b/src/service.c @@ -770,8 +770,7 @@ static int service_load(struct connman_service *service) str = g_key_file_get_string(keyfile, service->identifier, "Proxy.URL", NULL); if (str) { - g_free(service->pac); - service->pac = str; + service_set_pac(service, str, false); } service->mdns_config = g_key_file_get_boolean(keyfile, @@ -5757,12 +5756,9 @@ void __connman_service_timeserver_changed(struct connman_service *service, void __connman_service_set_pac(struct connman_service *service, const char *pac) { - if (service->hidden) - return; - g_free(service->pac); - service->pac = g_strdup(pac); + const bool dochanged = true; - proxy_changed(service); + service_set_pac(service, pac, dochanged); } void __connman_service_set_agent_identity(struct connman_service *service, @@ -6049,12 +6045,7 @@ static int update_proxy_configuration(struct connman_service *service, break; case CONNMAN_SERVICE_PROXY_METHOD_AUTO: - g_free(service->pac); - - if (url && strlen(url) > 0) - service->pac = g_strstrip(g_strdup(url)); - else - service->pac = NULL; + service_set_pac(service, url, false); /* if we are connected: - if service->pac == NULL From patchwork Thu Dec 12 05:28:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904684 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E05A13D52E for ; Thu, 12 Dec 2024 05:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; cv=none; b=LUz1vtGR6zzxvnN616O40pcO+WCKsvT6GUU1xCYFPEW+qZXdgYqt/i5PYeH1uKBn6P6Vziu0cUOnfp9VqYslc/uGFmja324eJKtlDyIh60xm++kT+mJjTLcrWeNYHzoVhkEuMD2OgSPpNfPdXNkkW3EBrefXET3S0UApFX9PXZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981834; c=relaxed/simple; bh=n9zOdnmARl0Ho9Hvo5Za5IE13jQQr2+qPZdZl7Blj2Y=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QeVGR21+TJcWqWwmRI3b2pjGSF6ZnvAFOMUoNECVztGMZtCWLtXZ1NIMJz7bCh8WZFFN7p0/410a6fHqIvbCltqgYZ0qH+S6goqk/i2RPK9myvmNm5lktg8zcIUAKoYgc9HK44kaqoQEQ8SY2c4OZLHpClmpBdGkX1fJ1lSvZ6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=R5eVXM+i; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="R5eVXM+i" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id ADF5A164A22 for ; Thu, 12 Dec 2024 00:28:20 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 64EF8125166 for ; Thu, 12 Dec 2024 00:28:20 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 04/15] service: Ensure the PAC URL is set in '__connman_service_set_proxy_autoconfig'. Date: Wed, 11 Dec 2024 21:28:06 -0800 Message-ID: <20241212052817.2021264-5-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=gLy7QA/y/LfnZaxMANYPxvO8+TTA0aR6yLK4PcN0hMc=; b=R5eVXM+iWWw63HIPzTEKWODdFrwD7GckyWjidF+5g/k4DQ3G5RQbCu8nygvEx4jlMBth1yzYr+uTQMZD2jbkyEBK1ZK3fyoBFHngGjHVAis0ttFSjnvdHH9rl4tGdpHjO4fEXazVxU6++cy5jCdUArpqvxcJ1R/LrFAC+Z4cioxhDHmqyh64OitaOvZVxvx/07DSbaHL8SUo/lvg1Aei+fsaizjr5aFYa3k9aFNdkcn1y4Usq2DH/t9tPj1fglh/8OFaJUFko/bNtMn2QaIw0aXqiriPjurI/IqKoBeli4ZZRyrG/Hx2wtxaOslXuwTs6r6YD6mXQv03av5z2aEMBg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Historically, there have been three (3) call sites in the network service code where the network service proxy auto-configuration (PAC) URL is set. However, it was never (but now, with this change, is) set in '__connman_service_set_proxy_autoconfig', where it is invoked by the DHCP client code when DHCP option 252 (Web Proxy Auto-Discovery (WPAD)) is encountered. --- src/service.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/service.c b/src/service.c index da851d681bc7..73cf8bca71a2 100644 --- a/src/service.c +++ b/src/service.c @@ -5600,9 +5600,13 @@ const char *connman_service_get_proxy_url(const struct connman_service *service) void __connman_service_set_proxy_autoconfig(struct connman_service *service, const char *url) { + const bool dochanged = true; + if (!service || service->hidden) return; + service_set_pac(service, url, !dochanged); + service->proxy = CONNMAN_SERVICE_PROXY_METHOD_AUTO; if (service->ipconfig_ipv4) { From patchwork Thu Dec 12 05:28:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904675 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0055168C3F for ; Thu, 12 Dec 2024 05:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; cv=none; b=iDQVCypJvvTk1JyZ1ri1zV5P8tsousH5AqxuKj47o/iHHO+Bkr29gaEq6JOGjLi1QQKHsi2TqvadbOcMAIbSW3lfk1BHAq35knxX7YV/v+bIHKLhd69qB3TKVpQ81ZWcE6Qu63V/ocfcwwKkREF+uB4fJvKr8WLAjoP6KUvPnfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; c=relaxed/simple; bh=61058HOzzhny93otOJskC3bMWkU3UTpzplzVkouhHeA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lq2XVOdcez0NCNwQiCNwVHND3bIuirkWCMh1g+QRwoKXK4p5nf8X/CLaiMrWUUntTvDbxdQom+7VuRN4sbBHPrgo5sO+fWtpO1q+smthTYLWfNP1/p9SHeQJHCmzZpcDbdGkhcZjQkPsTOwA0N7tV9d7RirXqXdDukP58Jh/Ik4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=mm3TRlin; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="mm3TRlin" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 28B87164A45 for ; Thu, 12 Dec 2024 00:28:21 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id D2C71125164 for ; Thu, 12 Dec 2024 00:28:20 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 05/15] service: Document 'service_log_pac'. Date: Wed, 11 Dec 2024 21:28:07 -0800 Message-ID: <20241212052817.2021264-6-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=mdKw2krJ28x56Ubzs4NgZ5fW4XkZzV7PGpcs8wMzYz4=; b=mm3TRlinuDPNbL9NVWeFfChygxaQyrEWrt6sWMZZ8n0TSkZDGjUHPMlpJKTQGbG/xkU+7gBc25iWeHWabGyBq/3LIF3IN3/FhpIZ8G1LMdNhXGGwmB97eepqnppcC7Z54Lt/0khztHeFcesxCS4e+sa5pM27jBEZiCvsY4GlGxfyV35N+wZM0sIC6IWrexlbbnPVegzMXWjK4qjr+Ft7PVevPr/iUwmAdEx/Lgq0NKVfy7EXTUriPCdpXkZsabN0RyLi+Vp4lYGErXse7DWO+Cv7t1JKBVfHDhCzQftdyXftvBMJVM/XHk5V9HaOl/gOkRyFot+D9/Xf1AYpsivIHw== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the 'service_log_pac' function. --- src/service.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/service.c b/src/service.c index 73cf8bca71a2..a4b13be2fd47 100644 --- a/src/service.c +++ b/src/service.c @@ -556,6 +556,21 @@ int __connman_service_load_modifiable(struct connman_service *service) return 0; } +/** + * @brief + * Log the proxy auto-configuration (PAC) URL associated with the + * specified service. + * + * @param[in] service A pointer to the immutable network + * service for which to log the proxy + * auto-configuration (PAC) URL. + * @param[in] url An optional pointer to the immutable null- + * terminated C string containing the proxy + * auto-configuration (PAC) URL. + * + * @private + * + */ static void service_log_pac(const struct connman_service *service, const char *url) { From patchwork Thu Dec 12 05:28:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904673 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C00AB17AE1C for ; Thu, 12 Dec 2024 05:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981308; cv=none; b=ZzvmOhGoX3XPnNLlGX8/2Pjn6iOx72X1bBL9KzxqCSJWfUSOzjSDUkyifnhJC1mf84oinCqHpnj0sxDvyQoxh3q4QlPx7gHRCUBq7nBjgupx6h6ZcVXSHVK10Z7svtOGD3s0ED90wEXlqkH1cDnRzPnHxFLtxxzWVERNt4Xmlow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981308; c=relaxed/simple; bh=57gUCku/I2vxPDcqPB+tkAZerP/lYQk5jOQAQyv5Rb4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sMvKHMlhlz+P7Sb8mf54tupYRxbCZ6o0bxpUX/NQR2XiGg5ZkkT22go7Ij53Ms89z5qwnSouNgclehdpG8NUWP8lgl5KxhJJ5IKAMRFH2bLa31GYdgMZxmU3mDsl+Fw1sOu+t/crXFEKVpQDcenQTl36oKPzMo/r8WVvyCiBlKE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=RhMwjYpU; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="RhMwjYpU" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 9864F164A4C for ; Thu, 12 Dec 2024 00:28:21 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 4CF64125164 for ; Thu, 12 Dec 2024 00:28:21 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 06/15] service: Document 'service_set_pac'. Date: Wed, 11 Dec 2024 21:28:08 -0800 Message-ID: <20241212052817.2021264-7-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=oIYv6aOm5waad1uh46Oa3qRiL7Tnh7VvBczHijDerzc=; b=RhMwjYpUeuiG5ClPAb6GfSnp2gjbPowdcbyMx/euM4nhEhJwtf8GC4htIifjbjdSTZjUvC29WKwvw+pj5roSFDbIZfDv3w9yiUsRKH0ZgjXbCV5rbEHMHoZxTypbwbVEfjkaJbVBbunMvEXeEmolWKn57d+2gWNZXihQTYpi6emjbGlUt99D40e/t6t1Rcc0mDi5UTDAOTGZf7sQVkZUGqASkbxeXJyWn60s5bdM+csFxtbgyLq+Agyi2muaWI9bBDZl7vHimipaIC34J8/0flZDzMQFfFwijDo1LnOQqhWrp3lAMcDsDN5gYvhTMdGf5uBdXsXth7/glP4GatP5ig== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the 'service_set_pac' function. --- src/service.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/service.c b/src/service.c index a4b13be2fd47..0713520d88a1 100644 --- a/src/service.c +++ b/src/service.c @@ -584,6 +584,30 @@ static void service_log_pac(const struct connman_service *service, url ? url : "is not set"); } +/** + * @brief + * Set and log the proxy auto-configuration (PAC) URL for the + * specified service. + * + * If the specified service is a hidden service, no set or log + * actions are taken. + * + * @param[in,out] service A pointer to the mutable network + * service for which to set the proxy + * auto-configuration (PAC) URL. + * @param[in] url An pointer to the immutable null- + * terminated C string containing the proxy + * auto-configuration (PAC) URL to set. + * @param[in] dochanged A Boolean indicating whether or a D-Bus + * change notification should be sent for + * the service "Proxy" property. + * + * @sa proxy_changed + * @sa service_log_pac + * + * @private + * + */ static void service_set_pac(struct connman_service *service, const char *pac, bool dochanged) From patchwork Thu Dec 12 05:28:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904679 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9E7017BEB7 for ; Thu, 12 Dec 2024 05:28:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; cv=none; b=XlK1RVNj0D/3G+KdpWPeWjod8yiRFAM9CIPDiFKJJdSXdFFRTRZV6j4f+j9Jei9nWeZlzVGly9rjDIwfAQuB4iTIoAe75Q2T9aLCOg4ekt2QZiNWvNKd9SxmC4iX2m5/eul6AM+uJ24WRMaVJxP+llVihxF/MiaPPEBpD3KqxUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; c=relaxed/simple; bh=bLq76X0qSxzQROLcYaepSthaA4BnwYP0Fftkg7G+tcA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XjGnsLBhfMytLDJJMebKb/ZL+VjfAL90dNVxQ4L7GSTxzoq7d9DmsGxoqIaH/9nYqcSyiopSYKikcQCJ9LF9hlw78uOuKrsG1hNK7CG6S/iEvDPR8ch3FuSejknUz7DfwLVM2aW1m1fi/osOwRnWqef4HWFFAF3hWJn/K9pYLJM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=XAD3wcpz; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="XAD3wcpz" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 120B8164A4D for ; Thu, 12 Dec 2024 00:28:22 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id BC5B9125164 for ; Thu, 12 Dec 2024 00:28:21 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 07/15] service: Add 'service_set_proxy_method' function. Date: Wed, 11 Dec 2024 21:28:09 -0800 Message-ID: <20241212052817.2021264-8-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=7zd9CaAvX9cIOWNcHFeJfp3VCY4w2FRil9KYudA48QM=; b=XAD3wcpzrzLGh+SdLH4dCUh8CRhMbA1BoEcB+OpdUm79jJYv3FfUCcW/cXqFh65Hhl3S8+lBQDkG2YeItrvuYhzGynQIzl9d99elnSC1ixWw1PNz8a9fk3m0U4k+GCxbfUTJ5ldSA21MjLDFRGJWfEnHveVSMGjzL4qfDnXYYeFJZJo/ekhRQNo4qY6oMNcLr2xMIoscpz17JsFV06ol9e7vqdOw7aWtAOQLQ1qFZXRUbHrLx4HclKcWBuLiziU6El8aBIKLzxgpLUAiFqPtZ52jTzHRxJrX1XteVgb5m9QEf7bMaYrRsAd2RBSxKGXUEQcujypWNgpIUBsqcKspQA== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Allows for logging, setting, and dispatching property changed notifications for the network service proxy method and associated URL, if any, from a single place. --- src/service.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/service.c b/src/service.c index 0713520d88a1..e58958635992 100644 --- a/src/service.c +++ b/src/service.c @@ -5568,6 +5568,37 @@ const char * const *connman_service_get_timeservers(const struct connman_service return (const char * const *)service->timeservers; } +static void service_set_proxy_method(struct connman_service *service, + enum connman_service_proxy_method method, + bool donotifier, + bool (*handler)(struct connman_service *service, + enum connman_service_proxy_method method, + const void *context), + const void *context) +{ + DBG("service %p (%s) method %d (%s) donotifier %u " + "handler %p, context %p", + service, connman_service_get_identifier(service), + method, proxymethod2string(method), + donotifier, + handler, + context); + + if (!service || service->hidden) + return; + + service->proxy = method; + + if (handler != NULL) + if (handler(service, method, context) != true) + return; + + proxy_changed(service); + + if (donotifier) + __connman_notifier_proxy_changed(service); +} + /** * @brief * Set the web proxy method of the specified service. From patchwork Thu Dec 12 05:28:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904674 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB62417C21B for ; Thu, 12 Dec 2024 05:28:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981308; cv=none; b=XokWXhvpQU0e7T5/ZawOgaJpXnho9UfGb0ikYIWgmEa6uctGQH7XqKlHilEPAI6aBkHgwSTyep4fnMGp8hOlOzrA1yolj9tBARrw4OntYjTkyViQtLi7mxvVUjxUICYJcMVLNkJVzVm/xLhy54ISwafAhnCgQ0ylUH5Vke+TkZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981308; c=relaxed/simple; bh=o+5g3TCP/NvqP6ob5P8QRjCiuzNJyXcrgiSJvfzVnrA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FlK7RzdwUVfN3xbc+6NZrdfmP7KBxA4NqCSvzA22ZDtgtL6/Z8cJlrS4hSSUW2JIcbLLmcu9I+5/bMr2uLELxsTDPoT5K2KYBLod1r2Wjz7VPGLV7rgBC1Iewcn7S33O4RnxPvKY/odyLjSH9El4KvDty3pD/gIrl1FoqMrNMgA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=B+QV17Ej; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="B+QV17Ej" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 823CC164A50 for ; Thu, 12 Dec 2024 00:28:22 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 360D4125164 for ; Thu, 12 Dec 2024 00:28:22 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 08/15] service: Leverage 'service_set_proxy_method'. Date: Wed, 11 Dec 2024 21:28:10 -0800 Message-ID: <20241212052817.2021264-9-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=i9NQtwYrWXU2VEI3jPtmOSwIa+ivhSK/aUcNUJQBWCY=; b=B+QV17Ej0lSzmyS10xdhTEjgBW70P+sOLPh4LwkHS3Ksdm+fG6AnUyK7kNE6Z/28ybQogR4zG2TED+zqYb9M3Jm2iqNb+s2uAoAnN9Wau1Y/OAzGmLBDz2NngWEAMKwnM61EfwGS7OTLXQt2kVF6Cvu6ajNSXumWAvXYkbSv9oy4eO/Awb6UDWpZUm+5Cskez4xGRn6I1YjaTojZ/7k1/PYPwkMHsTxrxYCPmxqe2BEL34ptTW80UZqGaK7QZxfD+4wSf5nt42+eqdWEES7iBAGYLSrOr/grMYIjEooj3W0b5aVqWiORQOf6nRASAbcYvE8KnvxyQQogwHm8GNdHIQ== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Leverage 'service_set_proxy_method' for 'connman_service_set_proxy_method', the first of two call sites. --- src/service.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/service.c b/src/service.c index e58958635992..5c94c2962de8 100644 --- a/src/service.c +++ b/src/service.c @@ -5617,19 +5617,14 @@ static void service_set_proxy_method(struct connman_service *service, void connman_service_set_proxy_method(struct connman_service *service, enum connman_service_proxy_method method) { - DBG("service %p (%s) method %d (%s)", - service, connman_service_get_identifier(service), - method, proxymethod2string(method)); - - if (!service || service->hidden) - return; - - service->proxy = method; + const bool donotifier = method != CONNMAN_SERVICE_PROXY_METHOD_AUTO; + void * const context = NULL; - proxy_changed(service); - - if (method != CONNMAN_SERVICE_PROXY_METHOD_AUTO) - __connman_notifier_proxy_changed(service); + service_set_proxy_method(service, + method, + donotifier, + NULL, + context); } enum connman_service_proxy_method connman_service_get_proxy_method( From patchwork Thu Dec 12 05:28:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904676 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D651166F29 for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; cv=none; b=dpSyFj39FdJNBZn6Jlw/BmvjT5mMkSGndWVR6p718T/zmxWgPrb+lkUhynZWH2Dhi393cnm7JDjlXMGo04T+R+hJon2a0CSplqTmGpECRjVi57NBJKYP6zJ5medR13yE7jHNIwI/YMWwd1JIPi4prioybzo291YdtlQnl7tsg+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; c=relaxed/simple; bh=sF0P/IxQWwEFRR9llBGL0YLgYAAMYdMm9//6fzFOdEk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZltV9hsIrqHn2cfJE0L+frW5Nxo+n+d0d37I7ddNcoHXYNbGzsUy6NLac/PRnYxFgMr6vaKAHmkGEXITtH+xghIExZecrqBABvwVip8hVaMF2qSNGitrKadY9V4cjUlUVO31cyMlCAnMl+12hiNFG92hk4ah3qSkci0Wz3/55Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=bJIj2Dmg; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="bJIj2Dmg" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 007BF164A51 for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id A6E5F125164 for ; Thu, 12 Dec 2024 00:28:22 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 09/15] service: Leverage 'service_set_proxy_method'. Date: Wed, 11 Dec 2024 21:28:11 -0800 Message-ID: <20241212052817.2021264-10-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=8XAx76eSCE0NfTT2qSURjx7LHO5cglpMg09x6rEGG78=; b=bJIj2Dmgi06QmfD1AOIZCTTMGbhCBershWKgTPHurRVuHv1sRDWHRJTgz+mWZJZ7eFWPsqf7tSvfJgXzeGJUOhKQRQrPy5bYoF1+MSC8FDyijVvmH25JHJ/TltFrlPANJS1X6aR93l4YhyE9Cgy5X6HjXpzr/F9Rj5cy7a/VMfHnOWQm+3k9O0GHvu6krdrDhmMb/ww324Kg0DyEAW0x7+/7MHsjFC/DKKXLcb+Y9jl/XP/Q7yEuckvKoN89g5Tk4WGbxjnHjeuYAfYUfPyeK4Th27VUKPuDkFOBZ+7kApXX3yJklGdvXeOaMP7dlAhjz8tsI7x0mB0XbzvhJsuKkQ== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Leverage 'service_set_proxy_method' for '__connman_service_set_proxy_autoconfig', the second of two call sites. --- src/service.c | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/src/service.c b/src/service.c index 5c94c2962de8..d2d8e7cea065 100644 --- a/src/service.c +++ b/src/service.c @@ -5662,32 +5662,47 @@ const char *connman_service_get_proxy_url(const struct connman_service *service) return service->pac; } -void __connman_service_set_proxy_autoconfig(struct connman_service *service, - const char *url) +static bool service_set_proxy_method_auto_handler( + struct connman_service *service, + enum connman_service_proxy_method method, + const void *context) { - const bool dochanged = true; - - if (!service || service->hidden) - return; - - service_set_pac(service, url, !dochanged); - - service->proxy = CONNMAN_SERVICE_PROXY_METHOD_AUTO; + const char * const url = context; if (service->ipconfig_ipv4) { if (__connman_ipconfig_set_proxy_autoconfig( - service->ipconfig_ipv4, url) < 0) - return; + service->ipconfig_ipv4, url) < 0) + return false; } else if (service->ipconfig_ipv6) { if (__connman_ipconfig_set_proxy_autoconfig( - service->ipconfig_ipv6, url) < 0) - return; + service->ipconfig_ipv6, url) < 0) + return false; } else - return; + return false; - proxy_changed(service); + return true; +} + +void __connman_service_set_proxy_autoconfig(struct connman_service *service, + const char *url) +{ + const bool dochanged = true; + const bool donotifier = true; + const void *context = url; - __connman_notifier_proxy_changed(service); + DBG("service %p (%s) url %p (%s)", + service, + connman_service_get_identifier(service), + url, + url ? url : ""); + + service_set_pac(service, url, !dochanged); + + service_set_proxy_method(service, + CONNMAN_SERVICE_PROXY_METHOD_AUTO, + donotifier, + service_set_proxy_method_auto_handler, + context); } const char *connman_service_get_proxy_autoconfig(struct connman_service *service) From patchwork Thu Dec 12 05:28:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904681 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A291917D366 for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; cv=none; b=X22tHbQ7n/Bw9n2H40PsJZ/0BjylR9DdQYpvkUurVS/0ANCp4a+1gav4s/pHFTmOv5Y8aXSOtVZxBOjBYMaiNvQZHzJYgzhDztUuX6Owa7EvyrC9a/Phas0qHkyFEbSfT20vBQRIuKF6JUkQHr5bswwEYPch//ZszPcIAm0jV28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; c=relaxed/simple; bh=MhA8GxcFawyataBCTq7owPmn6ubX8NIDsFCGXaYSbrM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JKf+rcSgLPjw7aupTwgr3bIcWDH7X/pf/0C6HjaLN9dv1H1NP88xxe50PXjfGHv+XRRHQ+pNqs0MDbV60/N8rlriHSxWhcJnXcr+MPDNIq49/BI5KcMT7iPDflyiOMI8Sh7Hyh7QRwRAvMbCvdvC/qDodLR/dyxv6Cf5BEQlR7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=GvTPL2If; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="GvTPL2If" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 6FD76164A52 for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 24819125164 for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 10/15] service: Document 'service_set_proxy_method'. Date: Wed, 11 Dec 2024 21:28:12 -0800 Message-ID: <20241212052817.2021264-11-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=DMEVtJxEypbJbdo46QA/JuNoLWGPwQUfFlkxSoG2fnI=; b=GvTPL2IfFPISrghIDp00tTVLo9Ivl01Qy9p3aMN9/bvlisEVRIqm9ycn52tgpIrngUGSwZTqzGGucVXT7xel2g18P9tilLM23AIXojrY0rCIuj4emQMou8qgUif4U6oRwo/C+/NvGoimqhsAAl1Jj3bVeQeTDVqysohZmO1Jv9EwfXlLgWuZFiuBNoKj9zw4s+t1EklADB91UJunkWGOlo3Dr7pflzBfo9bsbx9ipDahW2xx1Klm4iaA2DAP/irLk9X+GsNdT4DeN7BlPmDBBBUHKasfj6y9E6emVX6t/PcPozpBqUM2EzsMjgAlO5ePot6D3diEcV7sEYyHQNmaug== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the 'service_set_proxy_method' function. --- src/service.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/service.c b/src/service.c index d2d8e7cea065..3fd56188093d 100644 --- a/src/service.c +++ b/src/service.c @@ -5568,6 +5568,41 @@ const char * const *connman_service_get_timeservers(const struct connman_service return (const char * const *)service->timeservers; } +/** + * @brief + * Set the proxy method for the specified service. + * + * This attempts to set the proxy method for the specified + * service. If the service is null or if the service is hidden, no + * action is taken. If specified, a handler will be invoked, with the + * specified context, after setting the proxy method. + * + * If the handler is specified and it returns true, following, a + * D-Bus change notification should be sent for the service "Proxy" + * property and, if requested by @a donotifier, the proxy changed + * notifier chain will be run. + * + * @param[in,out] service A pointer to the mutable network + * service for which to set the proxy + * method. + * @param[in] method The network service proxy method to set + * on @a service. + * @param[in] donotifier A Boolean indicating whether the proxy + * changed notifier chain should be run + * after @a method is set on @a service. + * @param[in] handler An optional pointer to a handler that, + * if specified, will be invoked after @a + * method is set on @a service. + * @param[in] context An optional pointer to immutable context + * that will be passed to @a handler, + * along with @a service and @a method. + * + * @sa __connman_notifier_proxy_changed + * @sa proxy_changed + * + * @private + * + */ static void service_set_proxy_method(struct connman_service *service, enum connman_service_proxy_method method, bool donotifier, From patchwork Thu Dec 12 05:28:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904680 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A15CB17CA1B for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; cv=none; b=Pkxawc6XgT761ZJHxF+8l25U6MJFGKSq/3LdffQ3IGk5cfOHmgHrqz/IcumibjmnM2zVD71u9iXHsD7xinUjfPw7LtFajQBrq8ZWZkcUwUZAs9friMCrMrCM5ugtzqWL0SWeFYy1p+dS82k4NE9XZRtImEvHUI2/pFz5ldR2l50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981310; c=relaxed/simple; bh=pcdiA+kfE/4PfnJeswFZEsO08yj5hl60J6YA0hI2O5c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g8S7navO5YYPybIq7nFLZCZq2h7rk7q2sjjtBuB9N+JaKknV9RWTWvVxb8rTVjZOXgXkNHddnqa8a0Qe7dgyse9PQ/8HF1OvdO0BQ8aUs+DOEG0D2/CxRcsUQz2voKhneDKSjnEOxXheiO2HkR5eXIgZZmX2GXLLBktz4HWB4XA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=G685EjoB; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="G685EjoB" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id DEFC3164A5E for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 93ADB125164 for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 11/15] service: Document 'service_set_proxy_method_auto_handler'. Date: Wed, 11 Dec 2024 21:28:13 -0800 Message-ID: <20241212052817.2021264-12-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=iSeMwyHmrkTmageWa0zvLP83gaNER4Fyqup4KK8kLqw=; b=G685EjoBiz8ZY6vvPhuE3xhWTtE9nOuMcSB4Bxl/kAD7zV/nu3fqc4YU1kuu1toyL8RmfAQX3pcMG4rK93N4nQJ0UHPH3X7eg0FldlycX2fMmlKuc3UvBrdpWvg00cr/W0fB+k3mSSNky9eQeuOdLs4OVg8GpKUWVJW2AFjOjiEvwkeRrybMe1f6no9RYkARiEFUF82VqOA0nQbgr7xJYRh8R5/IhgNbvmxuM7vCgF/THZV8GiRCnLI8IuTNwD3J8FdLQHHhrEYtwuCcp2FU/gdLdD3QHn3QTq3pMcR55wPGp4c4W9EI8SZ1X1Vhxq1O6IwclDcRKSripmPz7wq+LQ== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the 'service_set_proxy_method_auto_handler' function. --- src/service.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/service.c b/src/service.c index 3fd56188093d..b27828d98a42 100644 --- a/src/service.c +++ b/src/service.c @@ -5697,6 +5697,36 @@ const char *connman_service_get_proxy_url(const struct connman_service *service) return service->pac; } +/** + * @brief + * A post-mutation handler for the service proxy method when the + * method is #CONNMAN_SERVICE_PROXY_METHOD_AUTO. + * + * @param[in,out] service A pointer to the mutable network + * service for which the proxy method was + * set. + * @param[in] method The network service proxy method @a + * service was set to. + * @param[in] context An pointer to immutable context + * that was passed, along with @a + * service, @a method, and this handler, + * to #service_set_proxy_method. For this + * handler, @a context is an optional + * null-terminated C string containing + * the service proxy auto-configuration + * (PAC) URL. + * + * @returns + * True if #service_set_proxy_method should continue with state + * change notifications and processing proxy notifier changes after + * the handler returns; otherwise, false. + * + * @sa __connman_ipconfig_set_proxy_autoconfig + * @sa service_set_proxy_method + * + * @private + * + */ static bool service_set_proxy_method_auto_handler( struct connman_service *service, enum connman_service_proxy_method method, From patchwork Thu Dec 12 05:28:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904677 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A56FB17E900 for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; cv=none; b=mOvPDTokFkf2VnqVAY+aBaWIQWsRME6/VAeBZf/TwY0nw2nO1UUEexA4qRzq8LdYYfhTZRJyTSCS2NI8vrQpeJ0uWvw1R2oO3l42Kwu4sD7/TAEiYKB/Y8+HztgEg/UV4WML05OLoGlqCP6312+51rWpbzGpuBJZ6d1KpkxyPmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; c=relaxed/simple; bh=OLcZcA2X+SwUaNljVtVGNIPngPy9YCn/knMOpQjD+RY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u2Oz+w82qjHsBZ3lLBn5qQtVeDWmOwQ+iePQUDRSo8vQBwOwKB9b7279OauZV3E6r5pF2a0arPyHbFBoT+UHCxoDP33m5vDfI3L7DGG4Dzmhr5ZnCw+9zVjzZGj3hO/lLI4giCKnJjvRXAR7kCKw4QrxOwS39vyg4gtDRZiqJsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=h/NFSvou; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="h/NFSvou" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 5996E164A60 for ; Thu, 12 Dec 2024 00:28:24 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 0E73B125164 for ; Thu, 12 Dec 2024 00:28:23 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 12/15] service: Document '__connman_service_set_proxy_autoconfig'. Date: Wed, 11 Dec 2024 21:28:14 -0800 Message-ID: <20241212052817.2021264-13-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=upXwsh8pay+i+IW0gkLNj6C+5LcKVcbrOtlcbMVLTWw=; b=h/NFSvou8IAZturPMHOADI2SuU0xHKBPw4rs0zPmYfuE8Ar1nGUCC+++xLSwJ66cTZrWpS41T4y/LBnij2VXFhaP2s1Zq+CwpOdTykl18QgG2IDsQwcnC5hRKs6IbhQbzcbbz0S6g1LXEpjHGBD+xu54wqm4aE/rLvAqg8wMFuSyPbJKAcEvgGb9HOJjNbHwvghnIfwiz1dX+TgHL0FOxthqmCpWJQ/kmRUc/voz1vuQ1y3bv7pKOfJgltbf7/6MwUEP6zJEvhSdfPW0dWQDzXqCDGXJE9VL1GEsili+7486GBi197wJxTqvRgeg6SmFQtfWbXsdWAgL4s02jUv+Gw== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the '__connman_service_set_proxy_autoconfig' function. --- src/service.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/service.c b/src/service.c index b27828d98a42..0cfb516016b5 100644 --- a/src/service.c +++ b/src/service.c @@ -5748,6 +5748,23 @@ static bool service_set_proxy_method_auto_handler( return true; } +/** + * @brief + * Set the network service proxy method to # and proxy + * auto-configuation (PAC) URL. + * + * @param[in,out] service A pointer to the mutable network + * service for which to set the proxy + * method. + * @param[in] url An optional pointer to the immutable + * null-terminated C string containing the + * proxy auto-configuration (PAC) URL. + * + * @sa service_set_pac + * @sa service_set_proxy_method + * @sa service_set_proxy_method_auto_handler + * + */ void __connman_service_set_proxy_autoconfig(struct connman_service *service, const char *url) { From patchwork Thu Dec 12 05:28:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904678 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A407617E016 for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; cv=none; b=d/IsyMGSOXXVV/O2QZvA2HaG1lTd4oXFtaj7R2k1qqHe5dBADko9sj2XGARXhDZUVGlW80YdE6YtkUWjzOJqwcwbwwcF7vtvwXvFVTMmG0JoLrbO3m0f+RWb96PR51ug388KR2sDkMnHg/9GLdpkFstBaVOYiklQ+jh1je6JhDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981309; c=relaxed/simple; bh=AvVP1kzGtYXjkdUdh39ZomKjDeeuTlBS+MQzjoCpXAQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gGgAXVX/bPVR14wsXg75pADeuky+/3tezNdoj4+r1Sz5LYe/+JjTcwlyLK/X5J5kg6TH/Iu0Cj9f/eYVqyB13/laZedoq901rpCEkFs1Z98nrMwrqJOFO9o0uHov4QpxIFDArh7N8zyg4bP26grb4u/RcaCmzDyvOZhKn4dRFrg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=qnAZ2cNN; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="qnAZ2cNN" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id C7FEE164A6B for ; Thu, 12 Dec 2024 00:28:24 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 7E1F3124EDB for ; Thu, 12 Dec 2024 00:28:24 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 13/15] wispr: Add 'wispr_log_proxy_failure' function. Date: Wed, 11 Dec 2024 21:28:15 -0800 Message-ID: <20241212052817.2021264-14-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=IbJ/ABYzcjORSy9HsV7N+9RNPWw1UC5n2FRAmSdXB1o=; b=qnAZ2cNNSwc1xoTApQbDMUHOMxpFXT5fjZa48xeoR0k/mose2qfDH+IabrtJ4z2GXpfcyA/RYhJ5IjjypgQVWikoWMthdLA0BcIheh07WajiFh/2w6tBemzGLsYDhW0BjNdLezajP0M7LAR69+o3w5b3N3kTRDgTvSka13u9A48Hc2iZIKhZZ+dsbXlEskhy5pYC/dQrscjxopz700AnbjtuHPRk28nlK1PqpQ6fW6IpDnOqd9kmCk4HdGCKR3EIUvHRSOSMWBw4Jtsrj2PratBDxMfD1UOJ1UJXI2kplGZnYgR77ZV6CKF8vTC+tkyQ3WZ5q6shPgDLxRxxLP+Ebg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Logs the network service interface name, type, proxy auto-configuration (PAC) URL, online check URL, and proxy failure reason at the error level when a Wireless Internet Service Provider roaming (WISPr) online reachability check proxy failure occurs. Frequently, a spurious, misconfigured, or otherwise incorrect PAC URL is the source of WISPr online reachability check failures. Because POSIX error codes are themselves limited (for example, there is no -EBADPROXY or -EPROXYLKUP codes) and their usage for WISPr failures is similarly limited (for example, -EINVAL), insight into the actual nature of an online reachability check failure is, by extension, limited. Consequently, log messages generated from this function provide crucial insight into triaging and resolving such failures. --- src/wispr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wispr.c b/src/wispr.c index b1b0f337d3f8..60a3a011da58 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -1118,6 +1118,24 @@ static char *parse_proxy(const char *proxy) return proxy_server; } +static void wispr_log_proxy_failure( + struct connman_wispr_portal_context const *wp_context, + const char *reason) +{ + g_autofree char *interface = NULL; + + interface = connman_service_get_interface(wp_context->service); + + connman_error("%s with proxy auto-configuration (PAC) URL %s " + "for %s [ %s ] online check URL %s", + reason, + connman_service_get_proxy_url(wp_context->service), + interface, + __connman_service_type2string( + connman_service_get_type(wp_context->service)), + wp_context->status_url); +} + static void proxy_callback(const char *proxy, void *user_data) { struct connman_wispr_portal_context *wp_context = user_data; From patchwork Thu Dec 12 05:28:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904683 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F25F17CA0B for ; Thu, 12 Dec 2024 05:28:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981311; cv=none; b=I1na1YqSTcH8kX0xS48Qxv3uHP35WPruRp2H7K2en72JNwJJcNSWCBK7TnAtMISvS1pCW7xg5L5L6pURe9Su45Z+Cg78F0vbitV5Vz//HytSZW8azsggFLx0B7AfpeeJ5M2VfvUW1vVFJcOwk1hYQfGdlBZyohR+6zHuC+p/IX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981311; c=relaxed/simple; bh=s+tqkvhhevWvS6C2o+LDJdgd/NBdu8s+G7234EczUwY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t4BflSiT2WeERWiBxvonETA+eKTPukTlJNd9fzsjbAAiARl0BJCwEXNIPUvfasyPAcjsqKNz3FndLMeeWIRF8xMqNYzp9h3kuyvH9r2bUVukCnCOYQCJ12d1fjaLSroUVe48GrXbgAu/u9vA4gQ5CzOGrkHDkFVpjuqZvhickT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=W114CcJd; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="W114CcJd" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 42720164A6D for ; Thu, 12 Dec 2024 00:28:25 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id ED088124EDB for ; Thu, 12 Dec 2024 00:28:24 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 14/15] wispr: Leverage 'wispr_log_proxy_failure'. Date: Wed, 11 Dec 2024 21:28:16 -0800 Message-ID: <20241212052817.2021264-15-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=a4vlkeonnzeLiFK08Pm2690IlI3UtTy1CuteZv3oQXo=; b=W114CcJdRbUm3yDHtW99tW9Fm6Pf9kssnKJRXVctptOwBbS+Bhxvtl+f2LoDUPc7wWB3wvOe7yP2vJVO6q3sAwOHOk4fhnbxIzQ728whULBepWBn1peVrOnRl/TxBYHpzT3iQfqucwINuUGyIz6BBGyFf17NVWYlQ+KKsPleQOVSl7ccUCGhaVK9rxzwOv9dnXMzYNUFNfN1k/26QbumxeTSp8Z+eIgZvFgv+mw252+i1ujVsi0JLEJ3RXttPV+OsDr/3V3CKuGMhePKWY95EFZ2X+0Pnrfd4iGu0o2+VaKNHVR44tTmpnLla/CFRA5IhIVQR2Z0RbAmI/iH9Vpgcg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Leverage 'wispr_log_proxy_failure' from 'proxy_callback' with the "No valid proxy" reason and from 'wispr_portal_detect' with the "Failed to lookup" reason on Wireless Internet Service Provider roaming (WISPr) online reachability check proxy failures. --- src/wispr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wispr.c b/src/wispr.c index 60a3a011da58..10990c725986 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -1147,7 +1147,7 @@ static void proxy_callback(const char *proxy, void *user_data) return; if (!proxy) { - DBG("no valid proxy"); + wispr_log_proxy_failure(wp_context, "No valid proxy"); wp_context->cb(wp_context->service, wp_context->type, @@ -1320,6 +1320,8 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context, proxy_callback, wp_context); if (wp_context->proxy_token == 0) { + wispr_log_proxy_failure(wp_context, "Failed to lookup"); + err = -EINVAL; wispr_portal_context_unref(wp_context); } From patchwork Thu Dec 12 05:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13904682 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66BA017E918 for ; Thu, 12 Dec 2024 05:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981311; cv=none; b=PXKCOvG8wOqKKJQnsdjxVYgJyZLiAYe5oShdzTjYtp6SW0Cte1UMDcbEZlaZdDwpKoascsC0MVlJiTuerhXHw/zPHUVP2pahbJeEgYrm2ty9NEtc9pUefzrT3bwL2ltwr8xZkj0EWcetCyIRXcPt1l/Eq91tqXUM8YRQ9nArTRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733981311; c=relaxed/simple; bh=06WLl114GJZPfnjKsGAazCqiq6NhLEV4/oIPjyb+t+A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UZT7XyB+ehriAo05vbWIPq61fbMkw+uC3wp2WqQ+gdoZ99OlEb+0NxOA6wiq+MFGLr9LjWo3UfGWuY305Z2UsXjpieK7qlERu099cQSpPl24RZLgsG/eiMfjrOkKiE0Dw6L0jRUKLWJA1hkF0IHswinnEyFuoKAgu/1Ou2whZlc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=tl51hRrw; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="tl51hRrw" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id B40CB164A6F for ; Thu, 12 Dec 2024 00:28:25 -0500 (EST) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 688FD124EDB for ; Thu, 12 Dec 2024 00:28:25 -0500 (EST) From: Grant Erickson To: connman@lists.linux.dev Subject: [PATCH 15/15] wispr: Document 'wispr_log_proxy_failure'. Date: Wed, 11 Dec 2024 21:28:17 -0800 Message-ID: <20241212052817.2021264-16-gerickson@nuovations.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241212052817.2021264-1-gerickson@nuovations.com> References: <20241212052817.2021264-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=D9gcQT5GxL9r3r50j8b9Y/P/CZlksDC0JO7cUogF18w=; b=tl51hRrwrznh29goUO3pp1kefK4kYu2oHGyUue46eAFDkYI2Q03gP8IePJ8C2P3TpmH7LZ9J+HU6ZFqAu//SvIrf6MXj1Hgr6sygoBa11vRaikmwRPypy1wM6KQyW12WzTbD1hb21vT4bUGd6yXYyYQ5XdejdHgkfAh7diTyPMq0GqZgv8+bSNsLzD1B+BI/UVuRyuK0MXqY6Z6W7XkvVg2nA9uBzlZsHKfzWK6cIjGh5JuRC4apgEowreO/TsGqq6dHw9hGqlruFoKnRcAI0E9FmRSc96oAEBApMdBp/g89UgNnGb2F5cdB6ehXLzOQUsOGhRljgb9qUKGJ/xqdUg== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Add documentation to the 'wispr_log_proxy_failure' function. --- src/wispr.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/wispr.c b/src/wispr.c index 10990c725986..9b0e4b24a3db 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -1118,6 +1118,26 @@ static char *parse_proxy(const char *proxy) return proxy_server; } +/** + * @brief + * Log a Wireless Internet Service Provider roaming (WISPr) proxy + * auto-configuration (PAC)-related online reachability check + * failure. + * + * @param[in] wp_context A pointer to the immutable WISPr/portal + * context for which to log the proxy + * auto-configuration (PAC)-related online + * reachability check failure. + * @param[in] reason A pointer to an immutable, null-terminated + * C string containing the reason for the + * proxy auto-configuration (PAC)-related + * online reachability check failure which + * will be included at the start of the log + * message. + * + * @private + * + */ static void wispr_log_proxy_failure( struct connman_wispr_portal_context const *wp_context, const char *reason)