Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:wait-pppd-properly into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 3b3e564ab96602badec9aad9d62d664252e72f45
Merged at revision: 342852a5adff3c59790f64b08fa509eaa3d2d3d2
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:wait-pppd-properly
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:network-manager/xenial/1.2.2
Diff against target: 60 lines (+18/-3)
1 file modified
src/ppp-manager/nm-pppd-plugin.c (+18/-3)
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato continuous-integration Approve
System Enablement Bot continuous-integration Needs Fixing
Review via email: mp+387041@code.launchpad.net

Commit message

core/pppd-plugin: wait to recover port settings before notifying death
Upstream commit a251712a

Description of the change

core/pppd-plugin: wait to recover port settings before notifying death
Upstream commit a251712a

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c
2index 4c16f1f..ac47673 100644
3--- a/src/ppp-manager/nm-pppd-plugin.c
4+++ b/src/ppp-manager/nm-pppd-plugin.c
5@@ -47,7 +47,7 @@ char pppd_version[] = VERSION;
6 static GDBusProxy *proxy = NULL;
7
8 static void
9-nm_phasechange (void *data, int arg)
10+nm_phasechange (int arg)
11 {
12 NMPPPStatus ppp_status = NM_PPP_STATUS_UNKNOWN;
13 char *ppp_phase;
14@@ -129,6 +129,16 @@ nm_phasechange (void *data, int arg)
15 }
16
17 static void
18+nm_phasechange_hook (void *data, int arg)
19+{
20+ /* We send the nofication in exitnotify instead */
21+ if (arg == PHASE_DEAD)
22+ return;
23+
24+ nm_phasechange (arg);
25+}
26+
27+static void
28 nm_ip_up (void *data, int arg)
29 {
30 ipcp_options opts = ipcp_gotoptions[0];
31@@ -142,7 +152,7 @@ nm_ip_up (void *data, int arg)
32
33 if (!opts.ouraddr) {
34 g_warning ("nm-ppp-plugin: (%s): didn't receive an internal IP from pppd!", __func__);
35- nm_phasechange (NULL, PHASE_DEAD);
36+ nm_phasechange (PHASE_DEAD);
37 return;
38 }
39
40@@ -339,6 +349,11 @@ nm_exit_notify (void *data, int arg)
41 {
42 g_return_if_fail (G_IS_DBUS_PROXY (proxy));
43
44+ /* We wait until this point to notify dead phase to make sure that
45+ * the serial port has recovered already its original settings.
46+ */
47+ nm_phasechange (PHASE_DEAD);
48+
49 g_message ("nm-ppp-plugin: (%s): cleaning up", __func__);
50
51 g_object_unref (proxy);
52@@ -408,7 +423,7 @@ plugin_init (void)
53 pap_passwd_hook = get_credentials;
54 pap_check_hook = get_pap_check;
55
56- add_notifier (&phasechange, nm_phasechange, NULL);
57+ add_notifier (&phasechange, nm_phasechange_hook, NULL);
58 add_notifier (&ip_up_notifier, nm_ip_up, NULL);
59 add_notifier (&exitnotify, nm_exit_notify, proxy);
60 add_ip6_notifier ();

Subscribers

People subscribed via source and target branches