diff options
| author | Michael Brown | 2005-05-01 15:59:34 +0200 |
|---|---|---|
| committer | Michael Brown | 2005-05-01 15:59:34 +0200 |
| commit | 0cfcd91558ef5c03326817e4a907f2e9c1c0c636 (patch) | |
| tree | ad010d52e3a534b76635fc392d1d53e9bd83142b /src | |
| parent | Add debugging for CNAME records. (diff) | |
| download | ipxe-0cfcd91558ef5c03326817e4a907f2e9c1c0c636.tar.gz ipxe-0cfcd91558ef5c03326817e4a907f2e9c1c0c636.tar.xz ipxe-0cfcd91558ef5c03326817e4a907f2e9c1c0c636.zip | |
Abort immediately if no nameserver is present.
Diffstat (limited to 'src')
| -rw-r--r-- | src/proto/dns.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/proto/dns.c b/src/proto/dns.c index b2f258bff..d74b29a9c 100644 --- a/src/proto/dns.c +++ b/src/proto/dns.c @@ -249,6 +249,12 @@ static int dns_resolv ( struct in_addr *addr, const char *name ) { unsigned int recursion = 0; unsigned int id = 1; + /* Fail immediately if we have no name server */ + if ( ! arptable[ARP_NAMESERVER].ipaddr.s_addr ) { + DBG ( "DNS has no nameserver\n" ); + return 0; + } + DBG ( "DNS resolving %s\n", name ); /* Set up the query data */ |
