[U-Boot] [RFC PATCH v3 5/7] common.h: add getenv_IP6addr
Chris Packham
judge.packham at gmail.com
Fri Jan 25 01:56:56 CET 2013
From: Chris Packham <chris.packham at alliedtelesis.co.nz>
Analogous to getenv_IPaddr but for IPv6. This allows the caller to get an
IP6addr_t from an environment variable.
Signed-off-by: Chris Packham <chris.packham at alliedtelesis.co.nz>
---
Changes in v3: None
Changes in v2: None
include/common.h | 6 ++++++
lib/net_utils.c | 1 -
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/common.h b/include/common.h
index 4ad17ea..59cd2eb 100644
--- a/include/common.h
+++ b/include/common.h
@@ -842,6 +842,12 @@ static inline IPaddr_t getenv_IPaddr(char *var)
return string_to_ip(getenv(var));
}
+#include <net6.h>
+static inline int getenv_IP6addr(char *var, IP6addr_t *a)
+{
+ return string_to_ip6(getenv(var), a);
+}
+
/*
* CONSOLE multiplexing.
*/
diff --git a/lib/net_utils.c b/lib/net_utils.c
index 1c80b25..c783ddc 100644
--- a/lib/net_utils.c
+++ b/lib/net_utils.c
@@ -27,7 +27,6 @@
*/
#include <common.h>
-#include <net6.h>
#include <linux/ctype.h>
IPaddr_t string_to_ip(const char *s)
--
1.7.12.rc2.16.g034161a
More information about the U-Boot
mailing list