]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/busybox/busybox-1.00/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.00 / dhcp-hostname.patch
1 --- busybox/networking/udhcp/dhcpc.c    2005-05-25 11:49:24.000000000 +0100
2 +++ busybox/networking/udhcp/dhcpc.c    2005-05-25 12:54:30.000000000 +0100
3 @@ -193,6 +193,7 @@
4         long now;
5         int max_fd;
6         int sig;
7 +       char hostbuf[256];      /* SUSv2: hostnames are <= 255 bytes */
8  
9         static const struct option arg_options[] = {
10                 {"clientid",    required_argument,      0, 'c'},
11 @@ -211,6 +212,14 @@
12                 {0, 0, 0, 0}
13         };
14  
15 +       if (gethostname (hostbuf, sizeof (hostbuf)) == 0) {
16 +               len = strlen (hostbuf);
17 +               client_config.hostname = xmalloc (len + 2);
18 +               client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
19 +               client_config.hostname[OPT_LEN] = len;
20 +               strncpy(client_config.hostname + 2, hostbuf, len);
21 +       }
22 +
23         /* get options */
24         while (1) {
25                 int option_index = 0;