]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/busybox/busybox-1.00/dhcpretrytime.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / busybox / busybox-1.00 / dhcpretrytime.patch
1
2 #
3 # Patch managed by http://www.holgerschurig.de/patcher.html
4 #
5
6 --- busybox-1.00-rc3/networking/udhcp/dhcpc.c~dhcpretrytime
7 +++ busybox-1.00-rc3/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 @@ -90,6 +91,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 @@ -204,6 +206,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 @@ -211,7 +214,7 @@
33         /* get options */
34         while (1) {
35                 int option_index = 0;
36 -               c = getopt_long(argc, argv, "c:fbH: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 @@ -257,6 +260,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 @@ -335,7 +341,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.00-rc3/networking/ifupdown.c~dhcpretrytime
61 +++ busybox-1.00-rc3/networking/ifupdown.c
62 @@ -538,7 +538,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 @@ -558,8 +558,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")) {