summaryrefslogtreecommitdiff
path: root/openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-05-09 17:44:12 +0000
committerRichard Purdie <richard@openedhand.com>2006-05-09 17:44:12 +0000
commitc4aeea061cef9be1956614b2654e1a7a0150b895 (patch)
treec946daa5fbd2ff9618d6abcdea47dfdce04bfe8a /openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch
parentd097b90ed729456b685e457c99ac9c64f96e214c (diff)
downloadopenembedded-core-c4aeea061cef9be1956614b2654e1a7a0150b895.tar.gz
openembedded-core-c4aeea061cef9be1956614b2654e1a7a0150b895.tar.bz2
openembedded-core-c4aeea061cef9be1956614b2654e1a7a0150b895.tar.xz
openembedded-core-c4aeea061cef9be1956614b2654e1a7a0150b895.zip
busybox 1.00 -> 1.01
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@384 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch')
-rw-r--r--openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch b/openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch
new file mode 100644
index 000000000..e0adea662
--- /dev/null
+++ b/openembedded/packages/busybox/busybox-1.01/dhcp-hostname.patch
@@ -0,0 +1,30 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- busybox-1.01/networking/udhcp/dhcpc.c~dhcp-hostname
++++ busybox-1.01/networking/udhcp/dhcpc.c
+@@ -193,6 +193,7 @@
+ int max_fd;
+ int sig;
+ int no_clientid = 0;
++ char hostbuf[256]; /* SUSv2: hostnames are <= 255 bytes */
+
+ static const struct option arg_options[] = {
+ {"clientid", required_argument, 0, 'c'},
+@@ -211,6 +212,14 @@
+ {0, 0, 0, 0}
+ };
+
++ if (gethostname (hostbuf, sizeof (hostbuf)) == 0) {
++ len = strlen (hostbuf);
++ client_config.hostname = xmalloc (len + 2);
++ client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
++ client_config.hostname[OPT_LEN] = len;
++ strncpy(client_config.hostname + 2, hostbuf, len);
++ }
++
+ /* get options */
+ while (1) {
+ int option_index = 0;