summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-10-03 15:44:36 +0200
committerThomas Haller <thaller@redhat.com>2018-10-11 05:56:18 +0200
commitd444fcde34f06711208494a65cd0ea9b9ba2c592 (patch)
tree6ec35e813acd7f1dd6251faa8cd620c3102c22fb
parent9aa628cedb707e9c4f0e0dba437ec22375a0032e (diff)
downloadNetworkManager-d444fcde34f06711208494a65cd0ea9b9ba2c592.tar.gz
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.
-rw-r--r--src/ndisc/nm-lndp-ndisc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c
index 8d237e86c7..8bb1812764 100644
--- a/src/ndisc/nm-lndp-ndisc.c
+++ b/src/ndisc/nm-lndp-ndisc.c
@@ -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;