ndisc: abort handling IO in event_ready() if we are unable to switch namespace

It should never happen that we are unable to switch the namespace.
However, in case it does, we cannot just return G_SOURCE_CONTINUE,
because we will just endlessly trying to process IO without actually
reading from the socket.

This shouldn't happen, but the instance is hosed and something is
very wrong. No longer handle the socket to avoid an endless loop.

(cherry picked from commit d444fcde34)
This commit is contained in:
Thomas Haller 2018-10-03 15:44:36 +02:00
parent efb9e2bc6b
commit 6631debaa3

View file

@ -497,8 +497,11 @@ event_ready (GIOChannel *source, GIOCondition condition, NMNDisc *ndisc)
_LOGD ("processing libndp events");
if (!nm_ndisc_netns_push (ndisc, &netns))
return G_SOURCE_CONTINUE;
if (!nm_ndisc_netns_push (ndisc, &netns)) {
/* something is very wrong. Stop handling events. */
priv->event_id = 0;
return G_SOURCE_REMOVE;
}
ndp_callall_eventfd_handler (priv->ndp);
return G_SOURCE_CONTINUE;