# HG changeset patch # User Pascal Bellard # Date 1207856630 0 # Node ID 38edb0e5bd67a65ac57719a5dbc3eed7282ba422 # Parent 0b58f274eec1e10e8fe12d169f348b062f59d339 Busybox/dhcpc: do not hang on network failure diff -r 0b58f274eec1 -r 38edb0e5bd67 busybox/receipt --- a/busybox/receipt Thu Apr 10 20:53:44 2008 +0200 +++ b/busybox/receipt Thu Apr 10 19:43:50 2008 +0000 @@ -17,6 +17,7 @@ patch -p0 < stuff/$PACKAGE-$VERSION-patch.u patch -p0 < stuff/$PACKAGE-$VERSION-vcsa2txt.u patch -p0 < stuff/$PACKAGE-$VERSION-cpio.u + patch -p0 < stuff/$PACKAGE-$VERSION-dhcpc.u cp stuff/$PACKAGE-$VERSION.config $PACKAGE-$VERSION/.config cd $PACKAGE-$VERSION make oldconfig diff -r 0b58f274eec1 -r 38edb0e5bd67 busybox/stuff/busybox-1.10.0-dhcpc.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.10.0-dhcpc.u Thu Apr 10 19:43:50 2008 +0000 @@ -0,0 +1,15 @@ +--- busybox-1.10.0/networking/udhcp/dhcpc.c ++++ busybox-1.10.0/networking/udhcp/dhcpc.c +@@ -377,7 +377,11 @@ + xid = random_xid(); + + /* send discover packet */ +- send_discover(xid, requested_ip); /* broadcast */ ++ if (send_discover(xid, requested_ip) < 0) { /* broadcast */ ++ bb_info_msg("No network, failing"); ++ retval = 1; ++ goto ret; ++ } + + timeout = discover_timeout; + packet_num++;