From 4a4439835dde96fc81f9e09889d8f82436b0331a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 11 Sep 2018 21:54:48 +0200 Subject: [PATCH] ppp: downgrade warning about repeated SetIfindex calls from ppp plugin In src/ppp/nm-pppd-plugin.c, it seems that pppd can invoke phasechange(PHASE_RUNNING:) multiple times. Hence, the plugin calls SetIfindex multiple times too. In nm-ppp-manager.c, we want to make sure that the ifindex does not change after it was set once. However, calling SetIfindex with the same ifindex is not something worth warning. Just log a debug message and nothing. Maybe the plugin should remember that it already set the ifindex, and avoid multiple D-Bus calls. But it's unclear that that is desired. For now, just downgrade the warning. --- src/ppp/nm-ppp-manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index fe2adf578e..e168613947 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -441,7 +441,10 @@ impl_ppp_manager_set_ifindex (NMDBusObject *obj, _LOGD ("set-ifindex %d", (int) ifindex); if (priv->ifindex >= 0) { - _LOGW ("can't change the ifindex from %d to %d", priv->ifindex, (int) ifindex); + if (priv->ifindex == ifindex) + _LOGD ("ignore repeated calls setting ifindex to %d", (int) ifindex); + else + _LOGW ("can't change the ifindex from %d to %d", priv->ifindex, (int) ifindex); goto out; }