Blame SOURCES/0028-ppp-unexport-ppp-manager-on-dispose.patch

fc9aca
From 6f9227609de574d1e69154d30025429a78aea4a9 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Wed, 7 Jun 2017 16:09:18 +0200
fc9aca
Subject: [PATCH 1/8] ppp: cast int argument for variadic
fc9aca
 g_signal_emit(NM_PPP_MANAGER_STATE_CHANGE) call
fc9aca
fc9aca
(cherry picked from commit 7b5251b35c23a625959aac9a1ff617a955b3daa3)
fc9aca
(cherry picked from commit 2aa4239cba745c67c6b4fa165c5c366d51c961a9)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 6 +++---
fc9aca
 1 file changed, 3 insertions(+), 3 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index c7836a8..37d7a46 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -365,7 +365,7 @@ impl_ppp_manager_set_state (NMPPPManager *manager,
fc9aca
                             GDBusMethodInvocation *context,
fc9aca
                             guint32 state)
fc9aca
 {
fc9aca
-	g_signal_emit (manager, signals[STATE_CHANGED], 0, state);
fc9aca
+	g_signal_emit (manager, signals[STATE_CHANGED], 0, (guint) state);
fc9aca
 
fc9aca
 	g_dbus_method_invocation_return_value (context, NULL);
fc9aca
 }
fc9aca
@@ -692,7 +692,7 @@ ppp_watch_cb (GPid pid, gint status, gpointer user_data)
fc9aca
 	_LOGD ("pppd pid %d cleaned up", priv->pid);
fc9aca
 	priv->pid = 0;
fc9aca
 	priv->ppp_watch_id = 0;
fc9aca
-	g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD);
fc9aca
+	g_signal_emit (manager, signals[STATE_CHANGED], 0, (guint) NM_PPP_STATUS_DEAD);
fc9aca
 }
fc9aca
 
fc9aca
 static gboolean
fc9aca
@@ -704,7 +704,7 @@ pppd_timed_out (gpointer data)
fc9aca
 	_ppp_cleanup (manager);
fc9aca
 	_ppp_kill (manager);
fc9aca
 
fc9aca
-	g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD);
fc9aca
+	g_signal_emit (manager, signals[STATE_CHANGED], 0, (guint) NM_PPP_STATUS_DEAD);
fc9aca
 
fc9aca
 	return FALSE;
fc9aca
 }
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From 7d485d2b0eec62a4b8345e261c958b9e15423220 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Wed, 7 Jun 2017 16:28:18 +0200
fc9aca
Subject: [PATCH 2/8] ppp: unexport NMPPPManager instance on dispose()
fc9aca
fc9aca
Let's explicitly unexports on dispose(). Probably that already
fc9aca
happened, because NMExportedObject asserts that it is unexported
fc9aca
during !quitting.
fc9aca
fc9aca
During quitting, we probably don't tear down the manager.
fc9aca
fc9aca
Anyway, we should always unexport.
fc9aca
fc9aca
(cherry picked from commit f07dca941dc327e11c4252688020d5fd0b9b3567)
fc9aca
(cherry picked from commit 5e656b5872e6399d6536e3fb043ca9c63e298774)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 4 ++++
fc9aca
 1 file changed, 4 insertions(+)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index 37d7a46..fd0b991 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -1234,8 +1234,12 @@ static void
fc9aca
 dispose (GObject *object)
fc9aca
 {
fc9aca
 	NMPPPManager *self = (NMPPPManager *) object;
fc9aca
+	NMExportedObject *exported = NM_EXPORTED_OBJECT (self);
fc9aca
 	NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (self);
fc9aca
 
fc9aca
+	if (nm_exported_object_is_exported (exported))
fc9aca
+		nm_exported_object_unexport (exported);
fc9aca
+
fc9aca
 	_ppp_cleanup (self);
fc9aca
 	_ppp_kill (self);
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From ca9bd14f512a060df129da9d490591886ce22ef7 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 13:57:47 +0200
fc9aca
Subject: [PATCH 3/8] ppp: inline and drop trivial function
fc9aca
 remove_timeout_handler()
fc9aca
fc9aca
(cherry picked from commit 0f16649ba27942e12c550449cc1669355118890f)
fc9aca
(cherry picked from commit 620adbcc7b2eb630299b9c0595b48e4823ccecde)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 12 ++----------
fc9aca
 1 file changed, 2 insertions(+), 10 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index fd0b991..efaf73a 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -179,14 +179,6 @@ monitor_stats (NMPPPManager *manager)
fc9aca
 /*****************************************************************************/
fc9aca
 
fc9aca
 static void
fc9aca
-remove_timeout_handler (NMPPPManager *manager)
fc9aca
-{
fc9aca
-	NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
fc9aca
-
fc9aca
-	nm_clear_g_source (&priv->ppp_timeout_handler);
fc9aca
-}
fc9aca
-
fc9aca
-static void
fc9aca
 cancel_get_secrets (NMPPPManager *self)
fc9aca
 {
fc9aca
 	NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (self);
fc9aca
@@ -415,7 +407,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager,
fc9aca
 
fc9aca
 	_LOGI ("(IPv4 Config Get) reply received.");
fc9aca
 
fc9aca
-	remove_timeout_handler (manager);
fc9aca
+	nm_clear_g_source (&priv->ppp_timeout_handler);
fc9aca
 
fc9aca
 	config = nm_ip4_config_new (nm_platform_link_get_ifindex (NM_PLATFORM_GET, priv->ip_iface));
fc9aca
 
fc9aca
@@ -511,7 +503,7 @@ impl_ppp_manager_set_ip6_config (NMPPPManager *manager,
fc9aca
 
fc9aca
 	_LOGI ("(IPv6 Config Get) reply received.");
fc9aca
 
fc9aca
-	remove_timeout_handler (manager);
fc9aca
+	nm_clear_g_source (&priv->ppp_timeout_handler);
fc9aca
 
fc9aca
 	config = nm_ip6_config_new (nm_platform_link_get_ifindex (NM_PLATFORM_GET, priv->ip_iface));
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From 848af80037e21e9cc6bf9459f39f10ad314217eb Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 14:00:14 +0200
fc9aca
Subject: [PATCH 4/8] ppp/trivial: fix whitespace
fc9aca
fc9aca
(cherry picked from commit 5c5fbe0a9f90c53215c70cc7a76ea011560172b8)
fc9aca
(cherry picked from commit 105ef99cbf7f503f05826430df0f8acf1d1f3af9)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 76 ++++++++++++++++++++++++------------------------
fc9aca
 1 file changed, 38 insertions(+), 38 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index efaf73a..558082f 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -595,64 +595,64 @@ ppp_exit_code (guint pppd_exit_status, GPid pid)
fc9aca
 	const char *msg;
fc9aca
 
fc9aca
 	switch (pppd_exit_status) {
fc9aca
-	case  1: 
fc9aca
-		msg = "Fatal pppd error"; 
fc9aca
+	case  1:
fc9aca
+		msg = "Fatal pppd error";
fc9aca
 		break;
fc9aca
-	case  2: 
fc9aca
-		msg = "pppd options error"; 
fc9aca
+	case  2:
fc9aca
+		msg = "pppd options error";
fc9aca
 		break;
fc9aca
-	case  3: 
fc9aca
-		msg = "No root priv error"; 
fc9aca
+	case  3:
fc9aca
+		msg = "No root priv error";
fc9aca
 		break;
fc9aca
-	case  4: 
fc9aca
-		msg = "No ppp module error"; 
fc9aca
+	case  4:
fc9aca
+		msg = "No ppp module error";
fc9aca
 		break;
fc9aca
-	case  5: 
fc9aca
-		msg = "pppd received a signal"; 
fc9aca
+	case  5:
fc9aca
+		msg = "pppd received a signal";
fc9aca
 		break;
fc9aca
-	case  6: 
fc9aca
-		msg = "Serial port lock failed"; 
fc9aca
+	case  6:
fc9aca
+		msg = "Serial port lock failed";
fc9aca
 		break;
fc9aca
-	case  7: 
fc9aca
-		msg = "Serial port open failed"; 
fc9aca
+	case  7:
fc9aca
+		msg = "Serial port open failed";
fc9aca
 		break;
fc9aca
-	case  8: 
fc9aca
-		msg = "Connect script failed"; 
fc9aca
+	case  8:
fc9aca
+		msg = "Connect script failed";
fc9aca
 		break;
fc9aca
-	case  9: 
fc9aca
-		msg = "Pty program error"; 
fc9aca
+	case  9:
fc9aca
+		msg = "Pty program error";
fc9aca
 		break;
fc9aca
-	case 10: 
fc9aca
-		msg = "PPP negotiation failed"; 
fc9aca
+	case 10:
fc9aca
+		msg = "PPP negotiation failed";
fc9aca
 		break;
fc9aca
-	case 11: 
fc9aca
-		msg = "Peer didn't authenticatie itself"; 
fc9aca
+	case 11:
fc9aca
+		msg = "Peer didn't authenticatie itself";
fc9aca
 		break;
fc9aca
-	case 12: 
fc9aca
-		msg = "Link idle: Idle Seconds reached."; 
fc9aca
+	case 12:
fc9aca
+		msg = "Link idle: Idle Seconds reached.";
fc9aca
 		break;
fc9aca
-	case 13: 
fc9aca
-		msg = "Connect time limit reached."; 
fc9aca
+	case 13:
fc9aca
+		msg = "Connect time limit reached.";
fc9aca
 		break;
fc9aca
-	case 14: 
fc9aca
+	case 14:
fc9aca
 		msg = "Callback negotiated, call should come back.";
fc9aca
 		break;
fc9aca
-	case 15: 
fc9aca
-		msg = "Lack of LCP echo responses"; 
fc9aca
+	case 15:
fc9aca
+		msg = "Lack of LCP echo responses";
fc9aca
 		break;
fc9aca
-	case 16: 
fc9aca
-		msg = "A modem hung up the phone"; 
fc9aca
+	case 16:
fc9aca
+		msg = "A modem hung up the phone";
fc9aca
 		break;
fc9aca
-	case 17: 
fc9aca
-		msg = "Loopback detected"; 
fc9aca
+	case 17:
fc9aca
+		msg = "Loopback detected";
fc9aca
 		break;
fc9aca
-	case 18: 
fc9aca
-		msg = "The init script failed"; 
fc9aca
+	case 18:
fc9aca
+		msg = "The init script failed";
fc9aca
 		break;
fc9aca
-	case 19: 
fc9aca
+	case 19:
fc9aca
 		msg = "Authentication error.\n"
fc9aca
-			"We failed to authenticate ourselves to the peer.\n"
fc9aca
-			"Maybe bad account or password?";
fc9aca
+		      "We failed to authenticate ourselves to the peer.\n"
fc9aca
+		      "Maybe bad account or password?";
fc9aca
 		break;
fc9aca
 	default:
fc9aca
 		msg = "Unknown error";
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From e2f6a3d1900949971adc1d44eb7c78465c11fb17 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 14:12:58 +0200
fc9aca
Subject: [PATCH 5/8] ppp: refactor ppp_exit_code() to split out error to
fc9aca
 string conversion
fc9aca
fc9aca
ppp_exit_code() does too much or too little. Either it should log
fc9aca
about all reasons why pppd exited, including signals, or it should
fc9aca
just do the status to string conversion. Split it.
fc9aca
fc9aca
(cherry picked from commit 3f64910b5249a8535deffddd0fd574c25b28dcea)
fc9aca
(cherry picked from commit ccda61b6fc0eb90a32ea2a4bc360c82406a26331)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 89 ++++++++++++++----------------------------------
fc9aca
 1 file changed, 26 insertions(+), 63 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index 558082f..d9044a4 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -589,74 +589,37 @@ nm_cmd_line_add_int (NMCmdLine *cmd, int i)
fc9aca
 
fc9aca
 /*****************************************************************************/
fc9aca
 
fc9aca
+NM_UTILS_LOOKUP_STR_DEFINE_STATIC (pppd_exit_code_to_str, int,
fc9aca
+	NM_UTILS_LOOKUP_DEFAULT ("Unknown error"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 1, "Fatal pppd error");
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 2, "pppd options error"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 3, "No root priv error"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 4, "No ppp module error"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 5, "pppd received a signal"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 6, "Serial port lock failed"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 7, "Serial port open failed"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 8, "Connect script failed"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM ( 9, "Pty program error"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (10, "PPP negotiation failed"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (11, "Peer didn't authenticatie itself"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (12, "Link idle: Idle Seconds reached."),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (13, "Connect time limit reached."),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (14, "Callback negotiated, call should come back."),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (15, "Lack of LCP echo responses"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (16, "A modem hung up the phone"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (17, "Loopback detected"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (18, "The init script failed"),
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (19, "Authentication error.\n"
fc9aca
+	                              "We failed to authenticate ourselves to the peer.\n"
fc9aca
+	                              "Maybe bad account or password?"),
fc9aca
+);
fc9aca
+
fc9aca
 static void
fc9aca
 ppp_exit_code (guint pppd_exit_status, GPid pid)
fc9aca
 {
fc9aca
 	const char *msg;
fc9aca
 
fc9aca
-	switch (pppd_exit_status) {
fc9aca
-	case  1:
fc9aca
-		msg = "Fatal pppd error";
fc9aca
-		break;
fc9aca
-	case  2:
fc9aca
-		msg = "pppd options error";
fc9aca
-		break;
fc9aca
-	case  3:
fc9aca
-		msg = "No root priv error";
fc9aca
-		break;
fc9aca
-	case  4:
fc9aca
-		msg = "No ppp module error";
fc9aca
-		break;
fc9aca
-	case  5:
fc9aca
-		msg = "pppd received a signal";
fc9aca
-		break;
fc9aca
-	case  6:
fc9aca
-		msg = "Serial port lock failed";
fc9aca
-		break;
fc9aca
-	case  7:
fc9aca
-		msg = "Serial port open failed";
fc9aca
-		break;
fc9aca
-	case  8:
fc9aca
-		msg = "Connect script failed";
fc9aca
-		break;
fc9aca
-	case  9:
fc9aca
-		msg = "Pty program error";
fc9aca
-		break;
fc9aca
-	case 10:
fc9aca
-		msg = "PPP negotiation failed";
fc9aca
-		break;
fc9aca
-	case 11:
fc9aca
-		msg = "Peer didn't authenticatie itself";
fc9aca
-		break;
fc9aca
-	case 12:
fc9aca
-		msg = "Link idle: Idle Seconds reached.";
fc9aca
-		break;
fc9aca
-	case 13:
fc9aca
-		msg = "Connect time limit reached.";
fc9aca
-		break;
fc9aca
-	case 14:
fc9aca
-		msg = "Callback negotiated, call should come back.";
fc9aca
-		break;
fc9aca
-	case 15:
fc9aca
-		msg = "Lack of LCP echo responses";
fc9aca
-		break;
fc9aca
-	case 16:
fc9aca
-		msg = "A modem hung up the phone";
fc9aca
-		break;
fc9aca
-	case 17:
fc9aca
-		msg = "Loopback detected";
fc9aca
-		break;
fc9aca
-	case 18:
fc9aca
-		msg = "The init script failed";
fc9aca
-		break;
fc9aca
-	case 19:
fc9aca
-		msg = "Authentication error.\n"
fc9aca
-		      "We failed to authenticate ourselves to the peer.\n"
fc9aca
-		      "Maybe bad account or password?";
fc9aca
-		break;
fc9aca
-	default:
fc9aca
-		msg = "Unknown error";
fc9aca
-	}
fc9aca
+	msg = pppd_exit_code_to_str (pppd_exit_status);
fc9aca
 
fc9aca
 	_LOGW ("pppd pid %d exited with error: %s", pid, msg);
fc9aca
 }
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From b2b6bf1cecc61d82590041aadee52cb9e95064b2 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 14:13:36 +0200
fc9aca
Subject: [PATCH 6/8] ppp: don't log newlines
fc9aca
fc9aca
(cherry picked from commit a814b96ebf02fa88f1a431d0a7459723a3af670d)
fc9aca
(cherry picked from commit 38b5d356de300f717df9c262c4fbf7ea0053aee6)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 4 ++--
fc9aca
 1 file changed, 2 insertions(+), 2 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index d9044a4..93660ef 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -609,8 +609,8 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (pppd_exit_code_to_str, int,
fc9aca
 	NM_UTILS_LOOKUP_STR_ITEM (16, "A modem hung up the phone"),
fc9aca
 	NM_UTILS_LOOKUP_STR_ITEM (17, "Loopback detected"),
fc9aca
 	NM_UTILS_LOOKUP_STR_ITEM (18, "The init script failed"),
fc9aca
-	NM_UTILS_LOOKUP_STR_ITEM (19, "Authentication error.\n"
fc9aca
-	                              "We failed to authenticate ourselves to the peer.\n"
fc9aca
+	NM_UTILS_LOOKUP_STR_ITEM (19, "Authentication error. "
fc9aca
+	                              "We failed to authenticate ourselves to the peer. "
fc9aca
 	                              "Maybe bad account or password?"),
fc9aca
 );
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From 13d2ba85f0ea1835cd5b18fe2844d49d0a1f5592 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 14:19:05 +0200
fc9aca
Subject: [PATCH 7/8] ppp: cleanup logging pppd exit reason in ppp_watch_cb
fc9aca
fc9aca
- don't use assert but be more graceful with g_return_if_fail().
fc9aca
- in case of failure, don't log a debug message after the warning.
fc9aca
  One message is sufficient, drop "pppd pid %d cleaned up".
fc9aca
- print GPid type as long long.
fc9aca
- increase log level to warning. pppd dying unexpectedly warrants a
fc9aca
  warning.
fc9aca
fc9aca
(cherry picked from commit 250e7239511f4c8de6831e3c16d8d5f6fac383dc)
fc9aca
(cherry picked from commit b87327a5fea4e80a33849b8ff9735c4b61b9434d)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 36 ++++++++++++++++--------------------
fc9aca
 1 file changed, 16 insertions(+), 20 deletions(-)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index 93660ef..575bf11 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -615,36 +615,32 @@ NM_UTILS_LOOKUP_STR_DEFINE_STATIC (pppd_exit_code_to_str, int,
fc9aca
 );
fc9aca
 
fc9aca
 static void
fc9aca
-ppp_exit_code (guint pppd_exit_status, GPid pid)
fc9aca
-{
fc9aca
-	const char *msg;
fc9aca
-
fc9aca
-	msg = pppd_exit_code_to_str (pppd_exit_status);
fc9aca
-
fc9aca
-	_LOGW ("pppd pid %d exited with error: %s", pid, msg);
fc9aca
-}
fc9aca
-
fc9aca
-static void
fc9aca
-ppp_watch_cb (GPid pid, gint status, gpointer user_data)
fc9aca
+ppp_watch_cb (GPid pid, int status, gpointer user_data)
fc9aca
 {
fc9aca
 	NMPPPManager *manager = NM_PPP_MANAGER (user_data);
fc9aca
 	NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
fc9aca
-	guint err;
fc9aca
+	int err;
fc9aca
+	const long long lpid = (long long) pid;
fc9aca
 
fc9aca
-	g_assert (pid == priv->pid);
fc9aca
+	g_return_if_fail (pid == priv->pid);
fc9aca
 
fc9aca
 	if (WIFEXITED (status)) {
fc9aca
 		err = WEXITSTATUS (status);
fc9aca
-		if (err != 0)
fc9aca
-			ppp_exit_code (err, priv->pid);
fc9aca
+		if (err) {
fc9aca
+			_LOGW ("pppd pid %lld exited with error %d: %s",
fc9aca
+			       lpid, err,
fc9aca
+			       pppd_exit_code_to_str (err));
fc9aca
+		} else
fc9aca
+			_LOGD ("pppd pid %lld exited with success", lpid);
fc9aca
 	} else if (WIFSTOPPED (status)) {
fc9aca
-		_LOGI ("pppd pid %d stopped unexpectedly with signal %d", priv->pid, WSTOPSIG (status));
fc9aca
+		_LOGW ("pppd pid %lld stopped unexpectedly with signal %d",
fc9aca
+		       lpid, WSTOPSIG (status));
fc9aca
 	} else if (WIFSIGNALED (status)) {
fc9aca
-		_LOGI ("pppd pid %d died with signal %d", priv->pid, WTERMSIG (status));
fc9aca
+		_LOGW ("pppd pid %lld died with signal %d",
fc9aca
+		       lpid, WTERMSIG (status));
fc9aca
 	} else
fc9aca
-		_LOGI ("pppd pid %d died from an unknown cause", priv->pid);
fc9aca
+		_LOGW ("pppd pid %lld died from an unknown cause", lpid);
fc9aca
 
fc9aca
-	_LOGD ("pppd pid %d cleaned up", priv->pid);
fc9aca
 	priv->pid = 0;
fc9aca
 	priv->ppp_watch_id = 0;
fc9aca
 	g_signal_emit (manager, signals[STATE_CHANGED], 0, (guint) NM_PPP_STATUS_DEAD);
fc9aca
@@ -971,7 +967,7 @@ _ppp_manager_start (NMPPPManager *manager,
fc9aca
 		goto out;
fc9aca
 	}
fc9aca
 
fc9aca
-	_LOGI ("pppd started with pid %d", priv->pid);
fc9aca
+	_LOGI ("pppd started with pid %lld", (long long) priv->pid);
fc9aca
 
fc9aca
 	priv->ppp_watch_id = g_child_watch_add (priv->pid, (GChildWatchFunc) ppp_watch_cb, manager);
fc9aca
 	priv->ppp_timeout_handler = g_timeout_add_seconds (timeout_secs, pppd_timed_out, manager);
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From baf5a6b24119671bb8a0edea2fc4830750c16305 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Fri, 9 Jun 2017 15:11:24 +0200
fc9aca
Subject: [PATCH 8/8] ppp: fix cancelling timeout when pppd process exits
fc9aca
fc9aca
Otherwise, we get pppd_timed_out() later, which will
fc9aca
emit a DEAD state change at unexpected times.
fc9aca
fc9aca
(cherry picked from commit b9af32b056ae7c93b33644b8a24641a86bf66e2c)
fc9aca
(cherry picked from commit 1b954fe09b3b968aa883bba1027f47487ac4808e)
fc9aca
---
fc9aca
 src/ppp/nm-ppp-manager.c | 1 +
fc9aca
 1 file changed, 1 insertion(+)
fc9aca
fc9aca
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c
fc9aca
index 575bf11..6343df8 100644
fc9aca
--- a/src/ppp/nm-ppp-manager.c
fc9aca
+++ b/src/ppp/nm-ppp-manager.c
fc9aca
@@ -643,6 +643,7 @@ ppp_watch_cb (GPid pid, int status, gpointer user_data)
fc9aca
 
fc9aca
 	priv->pid = 0;
fc9aca
 	priv->ppp_watch_id = 0;
fc9aca
+	_ppp_cleanup (manager);
fc9aca
 	g_signal_emit (manager, signals[STATE_CHANGED], 0, (guint) NM_PPP_STATUS_DEAD);
fc9aca
 }
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca