diff --git a/connman/src/connection.c b/connman/src/connection.c index cd21a3c4bc2e57afb878a49dfe7e905289bf2d27..f7ac70adc4e0976c761561ae93076c3528fcc115 100644 --- a/connman/src/connection.c +++ b/connman/src/connection.c @@ -1051,12 +1051,18 @@ bool __connman_connection_update_gateway(void) } } - if (updated && default_gateway) { - if (default_gateway->ipv4_gateway) + /* + * Set default gateway if it has been updated or if it has not been + * set as active yet. + */ + if (default_gateway) { + if (default_gateway->ipv4_gateway && + (updated || !default_gateway->ipv4_gateway->active)) set_default_gateway(default_gateway, CONNMAN_IPCONFIG_TYPE_IPV4); - if (default_gateway->ipv6_gateway) + if (default_gateway->ipv6_gateway && + (updated || !default_gateway->ipv6_gateway->active)) set_default_gateway(default_gateway, CONNMAN_IPCONFIG_TYPE_IPV6); }