1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-07-04 16:09:29 +00:00

network-watch: More descriptive warning

And make sure we're not continually spamming warnings.

Closes #330

(cherry picked from commit 4fc0a52873)
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-09-16 17:18:35 +02:00
parent ef7248d60c
commit 0380bc08eb

View file

@ -76,6 +76,8 @@ typedef struct _CallsNetworkWatch {
guint timeout_id;
gboolean repeated_warning;
char *ipv4;
char *ipv6;
char tmp_addr[INET6_ADDRSTRLEN];
@ -195,10 +197,17 @@ talk_rtnl (CallsNetworkWatch *self)
h = (struct nlmsghdr *) self->buf;
if (h->nlmsg_type == NLMSG_ERROR) {
g_warning ("An error occured in the netlink stack");
/* TODO figure out why this fails and provide more information in the warning */
if (!self->repeated_warning)
g_warning ("Unexpected error response to netlink request while trying "
"to fetch local IP address");
self->repeated_warning = TRUE;
return FALSE;
}
self->repeated_warning = FALSE;
return TRUE;
}