summaryrefslogtreecommitdiffstats
path: root/meta/packages/busybox/busybox-1.01/dhcp-hostname.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/busybox/busybox-1.01/dhcp-hostname.patch')
-rw-r--r--meta/packages/busybox/busybox-1.01/dhcp-hostname.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/packages/busybox/busybox-1.01/dhcp-hostname.patch b/meta/packages/busybox/busybox-1.01/dhcp-hostname.patch
new file mode 100644
index 0000000000..e0adea662e
--- /dev/null
+++ b/meta/packages/busybox/busybox-1.01/dhcp-hostname.patch
@@ -0,0 +1,30 @@
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;