diff options
Diffstat (limited to 'networking/dnsd.c')
-rw-r--r-- | networking/dnsd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/dnsd.c b/networking/dnsd.c index cb62d2081..97ba2dc6a 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c | |||
@@ -194,7 +194,8 @@ static int table_lookup(uint16_t type, uint8_t * as, uint8_t * qs) | |||
194 | for (i = 1; i <= (int)(d->name[0]); i++) | 194 | for (i = 1; i <= (int)(d->name[0]); i++) |
195 | if (tolower(qs[i]) != d->name[i]) | 195 | if (tolower(qs[i]) != d->name[i]) |
196 | break; | 196 | break; |
197 | if (i > (int)(d->name[0])) { | 197 | if (i > (int)(d->name[0]) || |
198 | (d->name[0] == 1 && d->name[1] == '*')) { | ||
198 | strcpy((char *)as, d->ip); | 199 | strcpy((char *)as, d->ip); |
199 | #if DEBUG | 200 | #if DEBUG |
200 | fprintf(stderr, " OK as:%s\n", as); | 201 | fprintf(stderr, " OK as:%s\n", as); |
@@ -202,7 +203,8 @@ static int table_lookup(uint16_t type, uint8_t * as, uint8_t * qs) | |||
202 | return 0; | 203 | return 0; |
203 | } | 204 | } |
204 | } else if (type == REQ_PTR) { /* search by IP-address */ | 205 | } else if (type == REQ_PTR) { /* search by IP-address */ |
205 | if (!strncmp((char*)&d->rip[1], (char*)&qs[1], strlen(d->rip)-1)) { | 206 | if ((d->name[0] != 1 || d->name[1] != '*') && |
207 | !strncmp((char*)&d->rip[1], (char*)&qs[1], strlen(d->rip)-1)) { | ||
206 | strcpy((char *)as, d->name); | 208 | strcpy((char *)as, d->name); |
207 | return 0; | 209 | return 0; |
208 | } | 210 | } |
@@ -401,7 +403,7 @@ int dnsd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
401 | r = process_packet(buf); | 403 | r = process_packet(buf); |
402 | if (r <= 0) | 404 | if (r <= 0) |
403 | continue; | 405 | continue; |
404 | send_to_from(udps, buf, r, 0, &to->u.sa, &from->u.sa, lsa->len); | 406 | send_to_from(udps, buf, r, 0, &from->u.sa, &to->u.sa, lsa->len); |
405 | } | 407 | } |
406 | return 0; | 408 | return 0; |
407 | } | 409 | } |