From 227c401a10a930af6fd5f123aef345fcd130d6aa Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Mon, 10 Dec 2018 21:58:18 +0100 Subject: Import Upstream version 1.12.6 --- src/ppp/nm-ppp-manager.c | 14 ++++++++------ src/ppp/nm-pppd-plugin.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/ppp') diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index 40bdea64..a2a4df70 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -438,10 +438,11 @@ impl_ppp_manager_set_ifindex (NMDBusObject *obj, g_variant_get (parameters, "(i)", &ifindex); - _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 ("set-ifindex: ignore repeated calls setting ifindex to %d", (int) ifindex); + else + _LOGW ("set-ifindex: can't change the ifindex from %d to %d", priv->ifindex, (int) ifindex); goto out; } @@ -454,14 +455,15 @@ impl_ppp_manager_set_ifindex (NMDBusObject *obj, } if (!plink) { - _LOGW ("unknown interface with ifindex %d", ifindex); + _LOGW ("set-ifindex: unknown interface with ifindex %d", ifindex); ifindex = 0; + } else { + obj_keep_alive = nmp_object_ref (NMP_OBJECT_UP_CAST (plink)); + _LOGD ("set-ifindex: %d, name \"%s\"", (int) ifindex, plink->name); } priv->ifindex = ifindex; - obj_keep_alive = nmp_object_ref (NMP_OBJECT_UP_CAST (plink)); - g_signal_emit (self, signals[IFINDEX_SET], 0, diff --git a/src/ppp/nm-pppd-plugin.c b/src/ppp/nm-pppd-plugin.c index 989f7433..09196340 100644 --- a/src/ppp/nm-pppd-plugin.c +++ b/src/ppp/nm-pppd-plugin.c @@ -147,7 +147,7 @@ nm_phasechange (void *data, int arg) if ( if_indextoname (index, new_name) && !nm_streq0 (ifname, new_name)) { g_message ("nm-ppp-plugin: interface name changed from '%s' to '%s'", ifname, new_name); - strncpy (ifname, new_name, IF_NAMESIZE); + g_strlcpy (ifname, new_name, IF_NAMESIZE); } } } -- cgit 1.3.0-6-gf8a5