* grub-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with
'_' in variable names. * grub-core/net/net.c (grub_net_network_level_interface_register): Likewise.
This commit is contained in:
parent
6ae485aaef
commit
1739b1fef8
3 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2012-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with
|
||||||
|
'_' in variable names.
|
||||||
|
* grub-core/net/net.c (grub_net_network_level_interface_register):
|
||||||
|
Likewise.
|
||||||
|
|
||||||
2012-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-05-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Fix AFFS with non-512B blocks.
|
Fix AFFS with non-512B blocks.
|
||||||
|
|
|
@ -39,7 +39,11 @@ set_env_limn_ro (const char *intername, const char *suffix,
|
||||||
char c;
|
char c;
|
||||||
char varname[sizeof ("net_") + grub_strlen (intername) + sizeof ("_")
|
char varname[sizeof ("net_") + grub_strlen (intername) + sizeof ("_")
|
||||||
+ grub_strlen (suffix)];
|
+ grub_strlen (suffix)];
|
||||||
|
char *ptr;
|
||||||
grub_snprintf (varname, sizeof (varname), "net_%s_%s", intername, suffix);
|
grub_snprintf (varname, sizeof (varname), "net_%s_%s", intername, suffix);
|
||||||
|
for (ptr = varname; *ptr; ptr++)
|
||||||
|
if (*ptr == ':')
|
||||||
|
*ptr = '_';
|
||||||
c = value[len];
|
c = value[len];
|
||||||
value[len] = 0;
|
value[len] = 0;
|
||||||
grub_env_set (varname, value);
|
grub_env_set (varname, value);
|
||||||
|
|
|
@ -820,8 +820,12 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa
|
||||||
{
|
{
|
||||||
char buf[GRUB_NET_MAX_STR_HWADDR_LEN];
|
char buf[GRUB_NET_MAX_STR_HWADDR_LEN];
|
||||||
char name[grub_strlen (inter->name) + sizeof ("net__mac")];
|
char name[grub_strlen (inter->name) + sizeof ("net__mac")];
|
||||||
|
char *ptr;
|
||||||
grub_net_hwaddr_to_str (&inter->hwaddress, buf);
|
grub_net_hwaddr_to_str (&inter->hwaddress, buf);
|
||||||
grub_snprintf (name, sizeof (name), "net_%s_mac", inter->name);
|
grub_snprintf (name, sizeof (name), "net_%s_mac", inter->name);
|
||||||
|
for (ptr = name; *ptr; ptr++)
|
||||||
|
if (*ptr == ':')
|
||||||
|
*ptr = '_';
|
||||||
grub_env_set (name, buf);
|
grub_env_set (name, buf);
|
||||||
grub_register_variable_hook (name, 0, hwaddr_set_env);
|
grub_register_variable_hook (name, 0, hwaddr_set_env);
|
||||||
}
|
}
|
||||||
|
@ -829,8 +833,12 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa
|
||||||
{
|
{
|
||||||
char buf[GRUB_NET_MAX_STR_ADDR_LEN];
|
char buf[GRUB_NET_MAX_STR_ADDR_LEN];
|
||||||
char name[grub_strlen (inter->name) + sizeof ("net__ip")];
|
char name[grub_strlen (inter->name) + sizeof ("net__ip")];
|
||||||
|
char *ptr;
|
||||||
grub_net_addr_to_str (&inter->address, buf);
|
grub_net_addr_to_str (&inter->address, buf);
|
||||||
grub_snprintf (name, sizeof (name), "net_%s_ip", inter->name);
|
grub_snprintf (name, sizeof (name), "net_%s_ip", inter->name);
|
||||||
|
for (ptr = name; *ptr; ptr++)
|
||||||
|
if (*ptr == ':')
|
||||||
|
*ptr = '_';
|
||||||
grub_env_set (name, buf);
|
grub_env_set (name, buf);
|
||||||
grub_register_variable_hook (name, 0, addr_set_env);
|
grub_register_variable_hook (name, 0, addr_set_env);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue