Skip to content

Commit

Permalink
pxe_dns: remove obsolete pxe_dns.c wrapper
Browse files Browse the repository at this point in the history
We used to need a wrapper around the core function dns_resolv() to
implement pxe_dns(), because the former function required its argument
to live in low memory.  This is no longer the case and hasn't been for
a while, so remove this unnecessary level of indirection.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
H. Peter Anvin committed Apr 6, 2016
1 parent cfafd66 commit edb6d3e
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 91 deletions.
2 changes: 1 addition & 1 deletion com32/include/syslinux/pxe_api.h
Expand Up @@ -587,7 +587,7 @@ typedef struct s_PXENV_UNLOAD_STACK {

int pxe_call(int, void *);
void unload_pxe(uint16_t flags);
uint32_t dns_resolv(const char *);
uint32_t pxe_dns(const char *);

extern uint32_t SendCookies;
void http_bake_cookies(void);
Expand Down
1 change: 0 additions & 1 deletion com32/lib/Makefile
Expand Up @@ -46,7 +46,6 @@ LIBSYSLINUX_OBJS = \
syslinux/reboot.o syslinux/keyboard.o \
syslinux/version.o \
syslinux/pxe_get_cached.o syslinux/pxe_get_nic.o \
syslinux/pxe_dns.o \
syslinux/video/fontquery.o syslinux/video/reportmode.o

DYNENTRY_OBJS = \
Expand Down
67 changes: 0 additions & 67 deletions com32/lib/syslinux/pxe_dns.c

This file was deleted.

2 changes: 1 addition & 1 deletion com32/libupload/upload_tftp.c
Expand Up @@ -117,7 +117,7 @@ static bool have_real_network(void)
return tftp_put != _dummy_tftp_put;
}

__weak uint32_t dns_resolv(const char *host)
__weak uint32_t pxe_dns(const char *host)
{
(void)host;

Expand Down
7 changes: 1 addition & 6 deletions com32/modules/host.c
Expand Up @@ -6,11 +6,6 @@
#include <com32.h>
#include <syslinux/pxe.h>

static inline uint32_t dns_resolve(const char *hostname)
{
return pxe_dns(hostname);
}

static inline void usage(const char *s)
{
fprintf(stderr, "Usage: %s hostname [, hostname_1, hostname_2, ...]\n", s);
Expand All @@ -29,7 +24,7 @@ int main(int argc, char *argv[])
}

for (i = 1; i < argc; i++) {
ip = dns_resolve(argv[i]);
ip = pxe_dns(argv[i]);
if (!ip) {
printf("%s not found.\n", argv[i]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion com32/samples/resolv.c
Expand Up @@ -25,7 +25,7 @@

uint32_t resolv(const char *name)
{
return dns_resolv(name);
return pxe_dns(name);
}

int main(int argc, char *argv[])
Expand Down
12 changes: 1 addition & 11 deletions core/fs/pxe/dnsresolv.c
Expand Up @@ -88,7 +88,7 @@ static bool parse_dotquad(const char *ip_str, uint32_t *res)
* _ip_ if it exists and can be found. If _ip_ = 0 on exit, the
* lookup failed. _name_ will be updated
*/
__export uint32_t dns_resolv(const char *name)
__export uint32_t pxe_dns(const char *name)
{
err_t err;
struct ip_addr ip;
Expand Down Expand Up @@ -122,13 +122,3 @@ __export uint32_t dns_resolv(const char *name)

return ip.addr;
}

/*
* the one should be called from ASM file
*/
void pm_pxe_dns_resolv(com32sys_t *regs)
{
const char *name = MK_PTR(regs->ds, regs->esi.w[0]);

regs->eax.l = dns_resolv(name);
}
2 changes: 1 addition & 1 deletion core/fs/pxe/pxe.c
Expand Up @@ -241,7 +241,7 @@ static void url_set_ip(struct url_info *url)
{
url->ip = 0;
if (url->host)
url->ip = dns_resolv(url->host);
url->ip = pxe_dns(url->host);
if (!url->ip)
url->ip = IPInfo.serverip;
}
Expand Down
2 changes: 1 addition & 1 deletion core/legacynet/dnsresolv.c
Expand Up @@ -208,7 +208,7 @@ static bool parse_dotquad(const char *ip_str, uint32_t *res)
*
* XXX: probably need some caching here.
*/
__export uint32_t dns_resolv(const char *name)
__export uint32_t pxe_dns(const char *name)
{
static char __lowmem DNSSendBuf[PKTBUF_SIZE];
static char __lowmem DNSRecvBuf[PKTBUF_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion efi/pxe.c
Expand Up @@ -35,7 +35,7 @@ int reset_pxe(void)
#define DNS_MAX_SERVERS 4 /* Max no of DNS servers */
uint32_t dns_server[DNS_MAX_SERVERS] = {0, };

__export uint32_t dns_resolv(const char *name)
__export uint32_t pxe_dns(const char *name)
{
/*
* Return failure on an empty input... this can happen during
Expand Down

0 comments on commit edb6d3e

Please sign in to comment.