summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.5.0-max_host_len_40.patch
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2007-05-07 04:07:06 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2007-05-07 04:07:06 +0000
commita70e39cd5e7c6fa084e548240d362b5b1ae813a8 (patch)
tree6d9456d66e331e694574a20a1fd3ca40ab6c75af /package/busybox/busybox-1.5.0-max_host_len_40.patch
parent58ef6b3ca7e0c195e7ef0d9523661aa333cf88b6 (diff)
downloadbuildroot-novena-a70e39cd5e7c6fa084e548240d362b5b1ae813a8.tar.gz
buildroot-novena-a70e39cd5e7c6fa084e548240d362b5b1ae813a8.zip
This patch increases the maximum host name length for 'dnsd' to 40 characters in length and fixes a resolving bug. For example, if there are two entries in the 'dnsd.conf' file of 'foo1' and 'foo2'. Doing a 'nslookup foo2' the 'dnsd' will always return the IP address of 'foo1' because the string comparison is faulty.
Diffstat (limited to 'package/busybox/busybox-1.5.0-max_host_len_40.patch')
-rw-r--r--package/busybox/busybox-1.5.0-max_host_len_40.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/package/busybox/busybox-1.5.0-max_host_len_40.patch b/package/busybox/busybox-1.5.0-max_host_len_40.patch
new file mode 100644
index 000000000..7b9ba1f77
--- /dev/null
+++ b/package/busybox/busybox-1.5.0-max_host_len_40.patch
@@ -0,0 +1,37 @@
+diff -ur busybox-1.5.0/networking/dnsd.c busybox-1.5.0-patched/networking/dnsd.c
+--- busybox-1.5.0/networking/dnsd.c 2007-03-22 15:21:23.000000000 -0500
++++ busybox-1.5.0-patched/networking/dnsd.c 2007-04-13 06:53:49.000000000 -0500
+@@ -30,7 +30,7 @@
+ #define DEBUG 0
+
+ enum {
+- MAX_HOST_LEN = 16, // longest host name allowed is 15
++ MAX_HOST_LEN = 41, // longest host name allowed is 40
+ IP_STRING_LEN = 18, // .xxx.xxx.xxx.xxx\0
+
+ //must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
+@@ -186,17 +186,21 @@
+ {
+ int i;
+ struct dns_entry *d=dnsentry;
++ char *p,*q;
++
++ q = (char *)&(qs[1]);
++ p = &(d->name[1]);
+
+ do {
+ #if DEBUG
+- char *p,*q;
+- q = (char *)&(qs[1]);
+- p = &(d->name[1]);
+ fprintf(stderr, "\n%s: %d/%d p:%s q:%s %d",
+ __FUNCTION__, (int)strlen(p), (int)(d->name[0]),
+ p, q, (int)strlen(q));
+ #endif
+ if (type == REQ_A) { /* search by host name */
++ p = &(d->name[1]);
++ if(strlen(q) != strlen(p))
++ continue;
+ for (i = 1; i <= (int)(d->name[0]); i++)
+ if (tolower(qs[i]) != d->name[i])
+ break;