[PATCH v2 28/42] Revert "vpn: Remove unused __vpn_provider_check_routes"
Jussi Laakkonen <[email protected]> Wed, 13 Aug 2025 18:02:00 +0300
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
This reverts commit 192696c5b032b0bdfa09950c43b569131315d490.
---
vpn/vpn-provider.c | 16 ++++++++++++++++
vpn/vpn.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index c05e4cf5..0462978b 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -3025,6 +3025,22 @@ void vpn_provider_set_auth_error_limit(struct vpn_provider *provider,
provider->auth_error_limit = limit;
}
+bool __vpn_provider_check_routes(struct vpn_provider *provider)
+{
+ if (!provider)
+ return false;
+
+ if (provider->user_routes &&
+ g_hash_table_size(provider->user_routes) > 0)
+ return true;
+
+ if (provider->routes &&
+ g_hash_table_size(provider->routes) > 0)
+ return true;
+
+ return false;
+}
+
void *vpn_provider_get_data(struct vpn_provider *provider)
{
return provider->driver_data;
diff --git a/vpn/vpn.h b/vpn/vpn.h
index 1f8c8fcd..97c0ad6c 100644
--- a/vpn/vpn.h
+++ b/vpn/vpn.h
@@ -73,6 +73,7 @@ void __vpn_ipconfig_cleanup(void);
#include "vpn-provider.h"
char *__vpn_provider_create_identifier(const char *host, const char *domain);
+bool __vpn_provider_check_routes(struct vpn_provider *provider);
int __vpn_provider_append_user_route(struct vpn_provider *provider,
int family, const char *network,
const char *netmask, const char *gateway);
--
2.39.5