#! /bin/sh /usr/share/dpatch/dpatch-run
# Description: Increase default timeout to ensure we don't hit it
#  In some cases, the 60 second client timeout has been shown to be too
#  low, resulting in ifupdown declaring an interface as 'up' when in fact
#  the dhclient has simply backgrounded to continue trying.  This is
#  addressed in ifupdown by calling dhclient3 with -1 (exit non-zero
#  after the timeout), but we don't ever want to *reach* that timeout:
#  having an interface fail to come up and never be retried is only
#  slightly better than having ifup say the interface is up before it is.
#  Now that ifup's dhclient handling is both reliable and highly
#  parallelized, we can afford to wait longer to be sure we don't hit
#  the timeout when DHCP is really working, so do this by default.
# Author: Steve Langasek <steve.langasek@ubuntu.com>
# Bug-Ubuntu: https://launchpad.net/bugs/838968

@DPATCH@
Index: isc-dhcp/client/clparse.c
===================================================================
--- isc-dhcp.orig/client/clparse.c	2012-06-22 14:59:47.015948000 -0400
+++ isc-dhcp/client/clparse.c	2012-06-22 15:04:20.818628135 -0400
@@ -122,7 +122,7 @@
 	memset (&top_level_config, 0, sizeof top_level_config);
 
 	/* Set some defaults... */
-	top_level_config.timeout = 60;
+	top_level_config.timeout = 300;
 	top_level_config.select_interval = 0;
 	top_level_config.reboot_timeout = 10;
 	top_level_config.retry_interval = 300;
Index: isc-dhcp/client/dhclient.conf
===================================================================
--- isc-dhcp.orig/client/dhclient.conf	2012-06-22 14:59:47.015948000 -0400
+++ isc-dhcp/client/dhclient.conf	2012-06-22 15:04:20.818628135 -0400
@@ -6,7 +6,7 @@
 request subnet-mask, broadcast-address, time-offset, routers,
 	domain-name, domain-name-servers, host-name;
 require subnet-mask, domain-name-servers;
-timeout 60;
+timeout 300;
 retry 60;
 reboot 10;
 select-timeout 5;
Index: isc-dhcp/client/dhclient.conf.5
===================================================================
--- isc-dhcp.orig/client/dhclient.conf.5	2012-06-22 14:59:47.015948000 -0400
+++ isc-dhcp/client/dhclient.conf.5	2012-06-22 15:04:20.818628135 -0400
@@ -74,7 +74,7 @@
 statement determines the amount of time that must pass between the
 time that the client begins to try to determine its address and the
 time that it decides that it's not going to be able to contact a
-server.   By default, this timeout is sixty seconds.   After the
+server.   By default, this timeout is 300 seconds.   After the
 timeout has passed, if there are any static leases defined in the
 configuration file, or any leases remaining in the lease database that
 have not yet expired, the client will loop through these leases
@@ -697,7 +697,7 @@
 
 .nf
 
-timeout 60;
+timeout 300;
 retry 60;
 reboot 10;
 select-timeout 5;
Index: isc-dhcp/doc/ja_JP.eucJP/dhclient.conf.5
===================================================================
--- isc-dhcp.orig/doc/ja_JP.eucJP/dhclient.conf.5	2012-06-22 14:59:47.015948000 -0400
+++ isc-dhcp/doc/ja_JP.eucJP/dhclient.conf.5	2012-06-22 15:04:20.818628135 -0400
@@ -77,7 +77,7 @@
 ʸϡ饤Ȥɥ쥹ߤ򳫻ϤƤ顢
 Ф˥뤳Ȥ
 ǤʤȽǤޤǤ˷в᤹٤֤ޤ
-ǥեȤǤϤΥॢͤ 60 äǤ
+ǥեȤǤϤΥॢͤ 300 äǤ
 Υॢͤ᤮ϡ
 ⤷Ūʥ꡼եƤ뤫
 ꡼ǡ١ˤޤڤˤʤäƤʤ꡼ĤäƤС
@@ -583,7 +583,7 @@
 
 .nf
 
-timeout 60;
+timeout 300;
 retry 60;
 reboot 10;
 select-timeout 5;
