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.
This commit is contained in:
Thomas Haller 2018-09-11 21:54:48 +02:00
parent 4d11eba8c5
commit 4a4439835d

View file

@ -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;
}