Peter Korsgaard wrote:
"Denys" == Denys Vlasenko <[email protected]> writes:

Hi,

 >> the post-down scripts are no longer executed, even though
 >> nothing has actually gone wrong...

 Denys> I do not want to add more special cases to ifupdown.
 Denys> There is a potentially infinite number of them.
 Denys> Use something better than ifupdown.

How about we just simplify the code instead then?

>From 288af213589462228c860c88ed4a8c3ec9bf6777 Mon Sep 17 00:00:00 2001
From: Peter Korsgaard <[email protected]>
Date: Thu, 22 Apr 2010 10:03:36 +0200
Subject: [PATCH] ifupdown: dhcp_down: ignore dhcp errors

Perform full down sequence even if the dhcp client couldn't be killed
(already gone, using ipv4ll fallback, ..).

Signed-off-by: Peter Korsgaard <[email protected]>
---
 networking/ifupdown.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index bf88b1c..f887001 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -572,8 +572,7 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t 
*ifd, execfn *exec)
 #elif ENABLE_UDHCPC
 static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
 {
-       int result;
-       result = execute("kill "
+       execute("kill "
                       "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, 
exec);
        /* Also bring the hardware interface down since
           killing the dhcp client alone doesn't do it.
@@ -581,8 +580,7 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t 
*ifd, execfn *exec)
        /* Sleep a bit, otherwise static_down tries to bring down interface too 
soon,
           and it may come back up because udhcpc is still shutting down */
        usleep(100000);
-       result += static_down(ifd, exec);
-       return ((result == 3) ? 3 : 0);
+       return static_down(ifd, exec);
 }
 #else
 static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM,
I thought about that too, but I wanted to avoid the 100 ms wait if possible


DISCLAIMER:
Unless indicated otherwise, the information contained in this message is 
privileged and confidential, and is intended only for the use of the 
addressee(s) named above and others who have been specifically authorized to 
receive it. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this message and/or attachments 
is strictly prohibited. The company accepts no liability for any damage caused 
by any virus transmitted by this email. Furthermore, the company does not 
warrant a proper and complete transmission of this information, nor does it 
accept liability for any delays. If you have received this message in error, 
please contact the sender and delete the message. Thank you.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to