https://bugzilla.novell.com/show_bug.cgi?id=815962
https://bugzilla.novell.com/show_bug.cgi?id=815962#c18
--- Comment #18 from Michael Chang 2013-06-25 05:00:37 UTC ---
(In reply to comment #17)
Thanks to the update. I will check what's missing.
That is upstream rev 4978.
------------------------------------------------------------
revno: 4978
committer: Vladimir 'phcoder' Serbinenko
branch nick: grub
timestamp: Tue 2013-05-07 12:05:36 +0200
message:
New variables 'net_default_*' to determine MAC/IP of default interface.
diff:
=== modified file 'ChangeLog'
--- ChangeLog 2013-05-07 09:47:30 +0000
+++ ChangeLog 2013-05-07 10:05:36 +0000
@@ -1,5 +1,9 @@
2013-05-07 Vladimir Serbinenko
+ New variables 'net_default_*' to determine MAC/IP of default interface.
+
+2013-05-07 Vladimir Serbinenko
+
* tests/gettext_strings_test.in: A test to check for strings not
marked for translation.
=== modified file 'grub-core/net/bootp.c'
--- grub-core/net/bootp.c 2013-01-20 13:24:47 +0000
+++ grub-core/net/bootp.c 2013-05-07 10:05:36 +0000
@@ -211,6 +211,9 @@
grub_print_error ();
}
+ if (is_def)
+ grub_env_set ("net_default_interface", name);
+
if (device && !*device && bp->server_ip)
{
*device = grub_xasprintf ("tftp,%d.%d.%d.%d",
=== modified file 'grub-core/net/net.c'
--- grub-core/net/net.c 2013-01-21 01:33:46 +0000
+++ grub-core/net/net.c 2013-05-07 10:05:36 +0000
@@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
- * Copyright (C) 2010,2011 Free Software Foundation, Inc.
+ * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -813,6 +813,69 @@
return grub_net_default_server ? : "";
}
+static const char *
+defip_get_env (struct grub_env_var *var __attribute__ ((unused)),
+ const char *val __attribute__ ((unused)))
+{
+ const char *intf = grub_env_get ("net_default_interface");
+ const char *ret = NULL;
+ if (intf)
+ {
+ char *buf = grub_xasprintf ("net_%s_ip", intf);
+ if (buf)
+ ret = grub_env_get (buf);
+ grub_free (buf);
+ }
+ return ret;
+}
+
+static char *
+defip_set_env (struct grub_env_var *var __attribute__ ((unused)),
+ const char *val)
+{
+ const char *intf = grub_env_get ("net_default_interface");
+ if (intf)
+ {
+ char *buf = grub_xasprintf ("net_%s_ip", intf);
+ if (buf)
+ grub_env_set (buf, val);
+ grub_free (buf);
+ }
+ return NULL;
+}
+
+
+static const char *
+defmac_get_env (struct grub_env_var *var __attribute__ ((unused)),
+ const char *val __attribute__ ((unused)))
+{
+ const char *intf = grub_env_get ("net_default_interface");
+ const char *ret = NULL;
+ if (intf)
+ {
+ char *buf = grub_xasprintf ("net_%s_mac", intf);
+ if (buf)
+ ret = grub_env_get (buf);
+ grub_free (buf);
+ }
+ return ret;
+}
+
+static char *
+defmac_set_env (struct grub_env_var *var __attribute__ ((unused)),
+ const char *val)
+{
+ const char *intf = grub_env_get ("net_default_interface");
+ if (intf)
+ {
+ char *buf = grub_xasprintf ("net_%s_mac", intf);
+ if (buf)
+ grub_env_set (buf, val);
+ grub_free (buf);
+ }
+ return NULL;
+}
+
static void
grub_net_network_level_interface_register (struct
grub_net_network_level_interface *inter)
@@ -1560,6 +1623,10 @@
defserver_set_env);
grub_register_variable_hook ("pxe_default_server", defserver_get_env,
defserver_set_env);
+ grub_register_variable_hook ("net_default_ip", defip_get_env,
+ defip_set_env);
+ grub_register_variable_hook ("net_default_mac", defmac_get_env,
+ defmac_set_env);
cmd_addaddr = grub_register_command ("net_add_addr", grub_cmd_addaddr,
/* TRANSLATORS: HWADDRESS stands for
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.