Allow the TFP server or boot server in --pxe-service, to

be a domain name instead of an IP address. This allows for
 round-robin to multiple servers, in the same way as
 --dhcp-boot.
This commit is contained in:
Simon Kelley
2012-02-10 15:24:51 +00:00
parent 9bbc88762b
commit 751d6f4ae6
5 changed files with 34 additions and 16 deletions

View File

@@ -2384,6 +2384,7 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line)
static int boottype = 32768;
new->netid = NULL;
new->sname = NULL;
new->server.s_addr = 0;
while (is_tag_prefix(arg))
@@ -2430,10 +2431,17 @@ static char *one_opt(int option, char *arg, char *gen_prob, int command_line)
new->basename = opt_string_alloc(arg);
}
if (comma && (new->server.s_addr = inet_addr(comma)) == (in_addr_t)-1)
option = '?';
if (comma)
{
if (!inet_pton(AF_INET, comma, &new->server))
{
new->server.s_addr = 0;
new->sname = opt_string_alloc(comma);
}
}
}
/* Order matters */
new->next = NULL;
if (!daemon->pxe_services)