From 6858e794f38b045b8f4de62165e120f439757cfa Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 3 Oct 2018 15:37:36 +0200 Subject: [PATCH] ndisc: first reschedule timeout before invoking change event in check_timestamps() It's just ugly to invoke external code in the middel of an operation. You never know, whether the handler won' unref the ndisc instance. (cherry picked from commit 1f856b7cb3dc1f229753d3a14acb26a8316ba13d) (cherry picked from commit a3c73e783b472745850110755f58923ff4cdc130) --- src/ndisc/nm-ndisc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ndisc/nm-ndisc.c b/src/ndisc/nm-ndisc.c index 04f8631298..1c0e094760 100644 --- a/src/ndisc/nm-ndisc.c +++ b/src/ndisc/nm-ndisc.c @@ -1132,9 +1132,6 @@ check_timestamps (NMNDisc *ndisc, gint32 now, NMNDiscConfigMap changed) clean_dns_servers (ndisc, now, &changed, &nextevent); clean_dns_domains (ndisc, now, &changed, &nextevent); - if (changed) - nm_ndisc_emit_config_change (ndisc, changed); - if (nextevent != G_MAXINT32) { if (nextevent <= now) g_return_if_reached (); @@ -1142,6 +1139,9 @@ check_timestamps (NMNDisc *ndisc, gint32 now, NMNDiscConfigMap changed) (int) (nextevent - now)); priv->timeout_id = g_timeout_add_seconds (nextevent - now, timeout_cb, ndisc); } + + if (changed) + nm_ndisc_emit_config_change (ndisc, changed); } static gboolean