1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-12 07:37:35 +00:00

network-watch: More descriptive warning

And make sure we're not continually spamming warnings.

Closes #330
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-09-16 17:18:35 +02:00
parent 9d27d5bae6
commit 4fc0a52873

View file

@ -76,6 +76,8 @@ typedef struct _CallsNetworkWatch {
guint timeout_id; guint timeout_id;
gboolean repeated_warning;
char *ipv4; char *ipv4;
char *ipv6; char *ipv6;
char tmp_addr[INET6_ADDRSTRLEN]; char tmp_addr[INET6_ADDRSTRLEN];
@ -195,10 +197,17 @@ talk_rtnl (CallsNetworkWatch *self)
h = (struct nlmsghdr *) self->buf; h = (struct nlmsghdr *) self->buf;
if (h->nlmsg_type == NLMSG_ERROR) { 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; return FALSE;
} }
self->repeated_warning = FALSE;
return TRUE; return TRUE;
} }