pass HOST_ variables, not BUILD_
[buildroot.git] / package / busybox / busybox-1.2.2.1-max_host_len_40.patch
blob3c3290054bd8d000989812b246de4014fe629cd6
1 diff -ur busybox-1.2.2.1/networking/dnsd.c busybox-1.2.2.1-patched/networking/dnsd.c
2 --- busybox-1.2.2.1/networking/dnsd.c 2006-10-24 15:21:17.000000000 -0500
3 +++ busybox-1.2.2.1-patched/networking/dnsd.c 2007-04-12 12:49:53.000000000 -0500
4 @@ -31,11 +31,11 @@
6 #define is_daemon() (flags&16)
7 #define is_verbose() (flags&32)
8 -//#define DEBUG
9 +#undef DEBUG
12 enum {
13 - MAX_HOST_LEN = 16, // longest host name allowed is 15
14 + MAX_HOST_LEN = 41, // longest host name allowed is 40
15 IP_STRING_LEN = 18, // .xxx.xxx.xxx.xxx\0
17 //must be strlen('.in-addr.arpa') larger than IP_STRING_LEN
18 @@ -229,19 +229,23 @@
20 int i;
21 struct dns_entry *d = dnsentry;
22 + char *p,*q;
24 + q = (char *)&(qs[1]);
25 + p = &(d->name[1]);
27 if(d) do {
28 #ifdef DEBUG
29 if(qs && d) {
30 - char *p,*q;
31 - q = (char *)&(qs[1]);
32 - p = &(d->name[1]);
33 fprintf(stderr, "\n%s: %d/%d p:%s q:%s %d",
34 __FUNCTION__, strlen(p), (int)(d->name[0]),
35 p, q, strlen(q));
37 #endif
38 if (type == REQ_A) { /* search by host name */
39 + p = &(d->name[1]);
40 + if(strlen(q) != strlen(p))
41 + continue;
42 for(i = 1; i <= (int)(d->name[0]); i++)
43 if(tolower(qs[i]) != d->name[i])
44 break;
45 @@ -398,13 +402,15 @@
46 fprintf(stderr,"fileconf: %s\n", fileconf);
49 - if(is_daemon())
50 + if(is_daemon()) {
51 #ifdef BB_NOMMU
52 /* reexec for vfork() do continue parent */
53 vfork_daemon_rexec(1, 0, argc, argv, "-d");
54 #else
55 bb_xdaemon(1, 0);
56 #endif
57 + daemonmode = 1;
58 + }
60 dnsentryinit(is_verbose());