summaryrefslogtreecommitdiffstats
path: root/meta/packages/busybox/busybox-1.01/dhcpretrytime.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/busybox/busybox-1.01/dhcpretrytime.patch')
-rw-r--r--meta/packages/busybox/busybox-1.01/dhcpretrytime.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/packages/busybox/busybox-1.01/dhcpretrytime.patch b/meta/packages/busybox/busybox-1.01/dhcpretrytime.patch
new file mode 100644
index 0000000000..e41ea9de55
--- /dev/null
+++ b/meta/packages/busybox/busybox-1.01/dhcpretrytime.patch
@@ -0,0 +1,81 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- busybox-1.01/networking/udhcp/dhcpc.c~dhcpretrytime
7+++ busybox-1.01/networking/udhcp/dhcpc.c
8@@ -48,6 +48,7 @@
9 static unsigned long requested_ip; /* = 0 */
10 static unsigned long server_addr;
11 static unsigned long timeout;
12+static unsigned long retrytime = 60;
13 static int packet_num; /* = 0 */
14 static int fd = -1;
15
16@@ -91,6 +92,7 @@
17 " -r, --request=IP IP address to request (default: none)\n"
18 " -s, --script=file Run file at dhcp events (default:\n"
19 " " DEFAULT_SCRIPT ")\n"
20+" -t, --retrytime time to retry DHCP request (default 60s)\n")
21 " -v, --version Display version\n"
22 );
23 exit(0);
24@@ -208,6 +210,7 @@
25 {"quit", no_argument, 0, 'q'},
26 {"request", required_argument, 0, 'r'},
27 {"script", required_argument, 0, 's'},
28+ {"retrytime", required_argument, 0, 't'},
29 {"version", no_argument, 0, 'v'},
30 {0, 0, 0, 0}
31 };
32@@ -223,7 +226,7 @@
33 /* get options */
34 while (1) {
35 int option_index = 0;
36- c = getopt_long(argc, argv, "c:CfbH:h:i:np:qr:s:v", arg_options, &option_index);
37+ c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:t:v", arg_options, &option_index);
38 if (c == -1) break;
39
40 switch (c) {
41@@ -274,6 +277,9 @@
42 case 's':
43 client_config.script = optarg;
44 break;
45+ case 't':
46+ retrytime = atol(optarg);
47+ break;
48 case 'v':
49 printf("udhcpcd, version %s\n\n", VERSION);
50 return 0;
51@@ -353,7 +359,7 @@
52 }
53 /* wait to try again */
54 packet_num = 0;
55- timeout = now + 60;
56+ timeout = now + retrytime;
57 }
58 break;
59 case RENEW_REQUESTED:
60--- busybox-1.01/networking/ifupdown.c~dhcpretrytime
61+++ busybox-1.01/networking/ifupdown.c
62@@ -541,7 +541,7 @@
63 static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
64 {
65 if (execable("/sbin/udhcpc")) {
66- return( execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i "
67+ return( execute("udhcpc -b -p /var/run/udhcpc.%iface%.pid -i "
68 "%iface% [[-H %hostname%]] [[-c %clientid%]]", ifd, exec));
69 } else if (execable("/sbin/pump")) {
70 return( execute("pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]]", ifd, exec));
71@@ -561,8 +561,8 @@
72 /* SIGUSR2 forces udhcpc to release the current lease and go inactive,
73 * and SIGTERM causes udhcpc to exit. Signals are queued and processed
74 * sequentially so we don't need to sleep */
75- result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
76- result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
77+ result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
78+ result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid 2>/dev/null` 2>/dev/null", ifd, exec);
79 } else if (execable("/sbin/pump")) {
80 result = execute("pump -i %iface% -k", ifd, exec);
81 } else if (execable("/sbin/dhclient")) {