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
diff --git a/src/ppp-manager/nm-pppd-plugin.c b/src/ppp-manager/nm-pppd-plugin.c
index 4c16f1f..ac47673 100644
--- a/src/ppp-manager/nm-pppd-plugin.c
+++ b/src/ppp-manager/nm-pppd-plugin.c
@@ -47,7 +47,7 @@ char pppd_version[] = VERSION;
47static GDBusProxy *proxy = NULL;47static GDBusProxy *proxy = NULL;
4848
49static void49static void
50nm_phasechange (void *data, int arg)50nm_phasechange (int arg)
51{51{
52 NMPPPStatus ppp_status = NM_PPP_STATUS_UNKNOWN;52 NMPPPStatus ppp_status = NM_PPP_STATUS_UNKNOWN;
53 char *ppp_phase;53 char *ppp_phase;
@@ -129,6 +129,16 @@ nm_phasechange (void *data, int arg)
129}129}
130130
131static void131static void
132nm_phasechange_hook (void *data, int arg)
133{
134 /* We send the nofication in exitnotify instead */
135 if (arg == PHASE_DEAD)
136 return;
137
138 nm_phasechange (arg);
139}
140
141static void
132nm_ip_up (void *data, int arg)142nm_ip_up (void *data, int arg)
133{143{
134 ipcp_options opts = ipcp_gotoptions[0];144 ipcp_options opts = ipcp_gotoptions[0];
@@ -142,7 +152,7 @@ nm_ip_up (void *data, int arg)
142152
143 if (!opts.ouraddr) {153 if (!opts.ouraddr) {
144 g_warning ("nm-ppp-plugin: (%s): didn't receive an internal IP from pppd!", __func__);154 g_warning ("nm-ppp-plugin: (%s): didn't receive an internal IP from pppd!", __func__);
145 nm_phasechange (NULL, PHASE_DEAD);155 nm_phasechange (PHASE_DEAD);
146 return;156 return;
147 }157 }
148158
@@ -339,6 +349,11 @@ nm_exit_notify (void *data, int arg)
339{349{
340 g_return_if_fail (G_IS_DBUS_PROXY (proxy));350 g_return_if_fail (G_IS_DBUS_PROXY (proxy));
341351
352 /* We wait until this point to notify dead phase to make sure that
353 * the serial port has recovered already its original settings.
354 */
355 nm_phasechange (PHASE_DEAD);
356
342 g_message ("nm-ppp-plugin: (%s): cleaning up", __func__);357 g_message ("nm-ppp-plugin: (%s): cleaning up", __func__);
343358
344 g_object_unref (proxy);359 g_object_unref (proxy);
@@ -408,7 +423,7 @@ plugin_init (void)
408 pap_passwd_hook = get_credentials;423 pap_passwd_hook = get_credentials;
409 pap_check_hook = get_pap_check;424 pap_check_hook = get_pap_check;
410425
411 add_notifier (&phasechange, nm_phasechange, NULL);426 add_notifier (&phasechange, nm_phasechange_hook, NULL);
412 add_notifier (&ip_up_notifier, nm_ip_up, NULL);427 add_notifier (&ip_up_notifier, nm_ip_up, NULL);
413 add_notifier (&exitnotify, nm_exit_notify, proxy);428 add_notifier (&exitnotify, nm_exit_notify, proxy);
414 add_ip6_notifier ();429 add_ip6_notifier ();

Subscribers

People subscribed via source and target branches