]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/busybox/busybox-1.01/dhcp-hostname.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / busybox / busybox-1.01 / dhcp-hostname.patch
1
2 #
3 # Patch managed by http://www.holgerschurig.de/patcher.html
4 #
5
6 --- busybox-1.01/networking/udhcp/dhcpc.c~dhcp-hostname
7 +++ busybox-1.01/networking/udhcp/dhcpc.c
8 @@ -193,6 +193,7 @@
9         int max_fd;
10         int sig;
11         int no_clientid = 0;
12 +       char hostbuf[256];      /* SUSv2: hostnames are <= 255 bytes */
13  
14         static const struct option arg_options[] = {
15                 {"clientid",    required_argument,      0, 'c'},
16 @@ -211,6 +212,14 @@
17                 {0, 0, 0, 0}
18         };
19  
20 +       if (gethostname (hostbuf, sizeof (hostbuf)) == 0) {
21 +               len = strlen (hostbuf);
22 +               client_config.hostname = xmalloc (len + 2);
23 +               client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
24 +               client_config.hostname[OPT_LEN] = len;
25 +               strncpy(client_config.hostname + 2, hostbuf, len);
26 +       }
27 +
28         /* get options */
29         while (1) {
30                 int option_index = 0;