Reintroduce pxe: syntax

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-02 22:12:37 +02:00
parent 308fad6dc8
commit 9daa203944

View file

@ -121,54 +121,35 @@ grub_pxefs_open (struct grub_file *file, const char *name)
if (!data) if (!data)
return grub_errno; return grub_errno;
#if 0 {
if (grub_strncmp (file->device->net->name, "pxe:", sizeof ("pxe:") - 1) == 0) grub_net_network_level_address_t addr;
{ grub_net_network_level_address_t gateway;
const char *ptr; struct grub_net_network_level_interface *interf;
grub_err_t err; grub_err_t err;
ptr = name + sizeof ("pxe:") - 1; if (grub_strncmp (file->device->net->name,
err = parse_ip (ptr, &(data->server_ip), &ptr); "pxe,", sizeof ("pxe,") - 1) == 0
if (err) || grub_strncmp (file->device->net->name,
return err; "pxe:", sizeof ("pxe:") - 1) == 0)
if (*ptr == ':') {
{ const char *ptr;
err = parse_ip (ptr + 1, &(data->gateway_ip), 0);
if (err) ptr = name + sizeof ("pxe,") - 1;
return err; err = grub_net_resolve_address (name + sizeof ("pxe,") - 1, &addr);
} if (err)
else return err;
data->gateway_ip = grub_pxe_default_gateway_ip; }
} else
else {
#endif addr.ipv4 = grub_pxe_default_server_ip;
{ addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4;
grub_net_network_level_address_t addr; }
grub_net_network_level_address_t gateway; err = grub_net_route_address (addr, &gateway, &interf);
struct grub_net_network_level_interface *interf; if (err)
grub_err_t err; return err;
data->server_ip = addr.ipv4;
if (grub_strncmp (file->device->net->name, data->gateway_ip = gateway.ipv4;
"pxe,", sizeof ("pxe,") - 1) == 0) }
{
const char *ptr;
ptr = name + sizeof ("pxe,") - 1;
err = grub_net_resolve_address (name + sizeof ("pxe,") - 1, &addr);
if (err)
return err;
}
else
{
addr.ipv4 = grub_pxe_default_server_ip;
addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4;
}
err = grub_net_route_address (addr, &gateway, &interf);
if (err)
return err;
data->server_ip = addr.ipv4;
data->gateway_ip = gateway.ipv4;
}
if (curr_file != 0) if (curr_file != 0)
{ {