1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 14:49:30 +00:00

network-watch: Don't fail initialization when unable to fetch local IP

This would mean we're failing when Calls is started with all NICs not connected
or disabled. To make matters worse this would only be fixable by restarting
Calls.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-09-16 15:58:16 +02:00
parent ab20b6b8e3
commit b5defda27f

View file

@ -396,7 +396,6 @@ calls_network_watch_initable_init (GInitable *initable,
GError **error)
{
CallsNetworkWatch *self = CALLS_NETWORK_WATCH (initable);
gboolean ret = FALSE;
self->fd = socket (AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (self->fd == -1 && error) {
@ -406,16 +405,17 @@ calls_network_watch_initable_init (GInitable *initable,
return FALSE;
}
if (fetch_ipv4 (self)) {
ret = TRUE;
if (fetch_ipv4 (self))
self->ipv4 = g_strdup (self->tmp_addr);
}
if (fetch_ipv6 (self)) {
ret = TRUE;
self->ipv6 = g_strdup (self->tmp_addr);
}
else
self->ipv4 = g_strdup ("127.0.0.1");
return ret;
if (fetch_ipv6 (self))
self->ipv6 = g_strdup (self->tmp_addr);
else
self->ipv6 = g_strdup ("::1");
return TRUE;
}