summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Danis <frederic.danis.external@sigfox.com>2018-09-11 18:56:49 +0200
committerThomas Haller <thaller@redhat.com>2018-09-11 21:22:37 +0200
commite66e4d0e718b0f9102160e98fb6a1bf059677d71 (patch)
tree63afbbeb86bbfbf6d1a8a0453ebd6b588da20a16
parent32506c8788c4481f7b33448c3e31661d4b50ab1a (diff)
downloadNetworkManager-e66e4d0e718b0f9102160e98fb6a1bf059677d71.tar.gz
ppp-manager: fix pppd not exiting correctly on modem hangup
When unplugging an USB 3G modem device, pppd does not exit correctly and we have the following traces: Sep 10 07:58:24.616465 ModemManager[1158]: <info> (tty/ttyUSB0): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1' Sep 10 07:58:24.620314 pppd[2292]: Modem hangup Sep 10 07:58:24.621368 ModemManager[1158]: <info> (tty/ttyUSB1): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1' Sep 10 07:58:24.621835 ModemManager[1158]: <warn> (ttyUSB1): could not re-acquire serial port lock: (5) Input/output error Sep 10 07:58:24.621358 NetworkManager[1871]: <debug> ppp-manager: set-ifindex 4 Sep 10 07:58:24.621369 NetworkManager[1871]: <warn> ppp-manager: can't change the ifindex from 4 to 4 Sep 10 07:58:24.623982 NetworkManager[1871]: <info> device (ttyUSB0): state change: activated -> unmanaged (reason 'removed', sys-iface-state: 'removed') Sep 10 07:58:24.624411 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): wait for process to terminate after sending SIGTERM (15) (send SIGKILL in 1500 milliseconds)... Sep 10 07:58:24.624440 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection Sep 10 07:58:24.626591 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection Sep 10 07:58:24.681016 NetworkManager[1871]: <warn> modem-broadband[ttyUSB0]: failed to disconnect modem: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.ModemManager1.Modem.Simple' on object at path /org/freedesktop/ModemManager1/Modem/0 Sep 10 07:58:26.126817 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): process not terminated after 1502368 usec. Sending SIGKILL signal Sep 10 07:58:26.128121 NetworkManager[1871]: <info> device (ppp0): state change: disconnected -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed') Sep 10 07:58:26.135571 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): terminated by signal 9 (1511158 usec elapsed) This is due to nm-ppp-plugin waiting on SetIfIndex call until timeout, which is longer than termination process timeout. Calling g_dbus_method_invocation_return_value() on error fixes this. Fixes: dd98ada33f33820e0d0874d9aa97e0c2bfc7cdd0 https://mail.gnome.org/archives/networkmanager-list/2018-September/msg00010.html
-rw-r--r--src/ppp/nm-ppp-manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
index fdec4763dc..b1dfe665ba 100644
--- a/src/ppp/nm-ppp-manager.c
+++ b/src/ppp/nm-ppp-manager.c
@@ -442,7 +442,7 @@ impl_ppp_manager_set_ifindex (NMDBusObject *obj,
if (priv->ifindex >= 0) {
_LOGW ("can't change the ifindex from %d to %d", priv->ifindex, (int) ifindex);
- return;
+ goto out;
}
if (ifindex > 0) {
@@ -463,6 +463,8 @@ impl_ppp_manager_set_ifindex (NMDBusObject *obj,
obj_keep_alive = nmp_object_ref (NMP_OBJECT_UP_CAST (plink));
g_signal_emit (self, signals[IFINDEX_SET], 0, ifindex, plink->name);
+
+out:
g_dbus_method_invocation_return_value (invocation, NULL);
}