diff options
| author | Michael Biebl <biebl@debian.org> | 2018-09-15 01:05:35 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-09-15 01:05:35 +0200 |
| commit | d1148fc0e24d30260606f292db3bb21ba9a6adc5 (patch) | |
| tree | 5f2251e1da11451b72c9dedbe629e3a90ec5bf13 /src/ppp | |
| parent | ffe03e75298bcd15849e314c8233cb9b696d59a3 (diff) | |
| parent | c240974325c552cad177c457d6ff04e381fd77a3 (diff) | |
Update upstream source from tag 'upstream/1.14.0'
Update to upstream version '1.14.0' with Debian dir a85bbd526d758f044876cc0acaa7be950ec06fae
Diffstat (limited to 'src/ppp')
| -rw-r--r-- | src/ppp/nm-ppp-manager.c | 22 | ||||
| -rw-r--r-- | src/ppp/nm-pppd-plugin.c | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index fdec4763..b231ff20 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -438,11 +438,12 @@ 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); - return; + 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; } if (ifindex > 0) { @@ -454,15 +455,22 @@ 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, + ifindex, + plink ? plink->name : NULL); - g_signal_emit (self, signals[IFINDEX_SET], 0, ifindex, plink->name); +out: g_dbus_method_invocation_return_value (invocation, NULL); } 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); } } } |