From edfcc9f1e582d0adb4da88330505771eccd59e6a Mon Sep 17 00:00:00 2001 From: Aleaxander Date: Wed, 26 Aug 2009 05:32:38 +0800 Subject: [PATCH] Core:pxelinux: fix the dns_resolv call reference in pxe.c The current dns_resolv function doesn't update the _name_ string, so we should use the strstr things to make the _p_ pointer to point to the right address we want. Signed-off-by: Liu Aleaxander --- core/fs/pxe/pxe.c | 4 ++-- core/fs/pxe/pxe.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c index 87d03eb..b300d6a 100644 --- a/core/fs/pxe/pxe.c +++ b/core/fs/pxe/pxe.c @@ -431,8 +431,8 @@ static void pxe_mangle_name(char *dst, const char *src) if ((p = parse_dotquad(p, &ip)) && !strncmp(p, "::", 2)) { p += 2; } else { - ip = dns_resolv(&p); - if (ip && !strncmp(p, "::", 2)) { + ip = dns_resolv(p); + if (ip && (p = strchr(p, ':')) && p[1] == ':') { p += 2; } else { /* no ip, too */ diff --git a/core/fs/pxe/pxe.h b/core/fs/pxe/pxe.h index c2b905f..a775f26 100644 --- a/core/fs/pxe/pxe.h +++ b/core/fs/pxe/pxe.h @@ -230,7 +230,7 @@ void parse_dhcp_options(void *, int, int); /* dnsresolv.c */ int dns_mangle(char **, const char *); -uint32_t dns_resolve(char **); +uint32_t dns_resolv(char *); #endif /* pxe.h */ -- 2.7.4