Hi Jukka,

> This is needed if P-t-P link does not have a default route.
> 
> Fixes BMC#25027
> ---
>  src/connection.c |   40 ++++++++++++++++++++++++++++++++--------
>  1 files changed, 32 insertions(+), 8 deletions(-)
> 
> diff --git a/src/connection.c b/src/connection.c
> index daaea42..9436c23 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -762,20 +762,44 @@ int __connman_connection_gateway_add(struct 
> connman_service *service,
>               active_gateway ? active_gateway->index : -1, new_gateway);
>  
>       if (type == CONNMAN_IPCONFIG_TYPE_IPV6 &&
> -                     new_gateway->ipv6_gateway != NULL &&
> -                     g_strcmp0(new_gateway->ipv6_gateway->gateway,
> -                                                             "::") != 0)
> -             connman_inet_add_ipv6_host_route(index,
> +                                     new_gateway->ipv6_gateway != NULL) {
> +             if (g_strcmp0(new_gateway->ipv6_gateway->gateway, "::") != 0) {
> +                     connman_inet_add_ipv6_host_route(index,
>                                       new_gateway->ipv6_gateway->gateway,
>                                       NULL);
> +             } else if (g_strcmp0(gateway, "::") == 0) {
> +                     /* P-t-P link */
> +                     char *dest;
> +                     if (connman_inet_ipv6_get_dest_addr(index,
> +                                                             &dest) == 0) {
> +                             connman_inet_add_ipv6_host_route(index, dest,
> +                                                             NULL);
> +                             g_free(dest);
> +                     }

same here. This has the tendency to also get messy soon. We need to make
this code way more readable.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to