3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- busybox-1.01/networking/udhcp/dhcpc.c~dhcpretrytime
7 +++ busybox-1.01/networking/udhcp/dhcpc.c
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 */
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"
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'},
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);
43 client_config.script = optarg;
46 + retrytime = atol(optarg);
49 printf("udhcpcd, version %s\n\n", VERSION);
53 /* wait to try again */
56 + timeout = now + retrytime;
60 --- busybox-1.01/networking/ifupdown.c~dhcpretrytime
61 +++ busybox-1.01/networking/ifupdown.c
63 static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
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));
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")) {