From 284ae5d0427e59def2210ecfc262965ade767337 Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Fri, 28 Aug 2009 19:26:04 +0800 Subject: Core:pxelinux: fix the probaly hang when use host We shoud check the server if vaild or not; if not, move no until we run out the time. Signed-off-by: Liu Aleaxander --- core/fs/pxe/dnsresolv.c | 2 ++ core/fs/pxe/pxe.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/fs/pxe/dnsresolv.c b/core/fs/pxe/dnsresolv.c index b2c36b7f..70e00c67 100644 --- a/core/fs/pxe/dnsresolv.c +++ b/core/fs/pxe/dnsresolv.c @@ -217,6 +217,8 @@ uint32_t dns_resolv(const char *name) timeout = *timeout_ptr++; while (srv_ptr < dns_server + DNS_MAX_SERVERS) { srv = *srv_ptr++; + if (!srv) + continue; /* just move on before runing the time out */ uw_pkt.status = 0; uw_pkt.sip = srv; uw_pkt.gip = ((srv ^ MyIP) & Netmask) ? Gateway : 0; diff --git a/core/fs/pxe/pxe.h b/core/fs/pxe/pxe.h index a775f26c..86bf92f7 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_resolv(char *); +uint32_t dns_resolv(const char *); #endif /* pxe.h */ -- cgit v1.2.1