summaryrefslogtreecommitdiffstats
path: root/network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch
diff options
context:
space:
mode:
Diffstat (limited to 'network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch')
-rw-r--r--network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch b/network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch
new file mode 100644
index 0000000000..41e6bbd3e6
--- /dev/null
+++ b/network/NetworkManager/patches/dhcp-ensure-that-dhcp-client-is-exited.patch
@@ -0,0 +1,38 @@
+From 3d3c87774381cee77bae911367a12e8c86d6ad99 Mon Sep 17 00:00:00 2001
+From: Mikhail Efremov <sem@altlinux.org>
+Date: Fri, 19 Nov 2010 16:52:55 -0600
+Subject: [PATCH 3/4] dhcp: ensure that dhcp client is exited
+
+On restart ensure that the client we're trying to kill has
+actually exited even if it's not our child.
+---
+ src/dhcp-manager/nm-dhcp-client.c | 12 ++++++++----
+ 1 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c
+index 0c7f3d4..3a8b194 100644
+--- a/src/dhcp-manager/nm-dhcp-client.c
++++ b/src/dhcp-manager/nm-dhcp-client.c
+@@ -156,11 +156,15 @@ stop_process (GPid pid, const char *iface)
+
+ if (ret == -1) {
+ /* Child already exited */
+- if (errno == ECHILD)
++ if (errno == ECHILD) {
++ /* Was it really our child and it exited? */
++ if (kill (pid, 0) < 0 && errno == ESRCH)
++ break;
++ } else {
++ /* Took too long; shoot it in the head */
++ i = 0;
+ break;
+- /* Took too long; shoot it in the head */
+- i = 0;
+- break;
++ }
+ }
+ g_usleep (G_USEC_PER_SEC / 5);
+ }
+--
+1.7.3.4
+