This is needed when restarting the VPN connection and the IP address changes. --- vpn/vpn-provider.c | 16 ++++++++++++++++ vpn/vpn-provider.h | 1 + 2 files changed, 17 insertions(+)
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index c39ebf9..ba1add3 100644 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -2544,6 +2544,22 @@ const char *vpn_provider_get_path(struct vpn_provider *provider) return provider->path; } +void vpn_provider_change_address(struct vpn_provider *provider) +{ + switch (provider->family) { + case AF_INET: + connman_inet_set_address(provider->index, + __vpn_ipconfig_get_address(provider->ipconfig_ipv4)); + break; + case AF_INET6: + connman_inet_set_ipv6_address(provider->index, + __vpn_ipconfig_get_address(provider->ipconfig_ipv6)); + break; + default: + break; + } +} + static int agent_probe(struct connman_agent *agent) { DBG("agent %p", agent); diff --git a/vpn/vpn-provider.h b/vpn/vpn-provider.h index 22b2062..4b73e8e 100644 --- a/vpn/vpn-provider.h +++ b/vpn/vpn-provider.h @@ -107,6 +107,7 @@ const char *vpn_provider_get_save_group(struct vpn_provider *provider); const char *vpn_provider_get_name(struct vpn_provider *provider); const char *vpn_provider_get_host(struct vpn_provider *provider); const char *vpn_provider_get_path(struct vpn_provider *provider); +void vpn_provider_change_address(struct vpn_provider *provider); typedef void (* vpn_provider_connect_cb_t) (struct vpn_provider *provider, void *user_data, int error); -- 1.8.3.1 _______________________________________________ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman