From patchwork Fri Jan 18 01:35:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 213421 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E0DF02C0040 for ; Fri, 18 Jan 2013 12:36:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EBD3B4A10A; Fri, 18 Jan 2013 02:36:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kq5pEN3kgZR1; Fri, 18 Jan 2013 02:36:24 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F2844A10C; Fri, 18 Jan 2013 02:36:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 473324A114 for ; Fri, 18 Jan 2013 02:36:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3nVaHiMf8NLJ for ; Fri, 18 Jan 2013 02:36:18 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gate.alliedtelesyn.co.nz (gate.alliedtelesyn.co.nz [202.49.72.33]) by theia.denx.de (Postfix) with SMTP id 08E6F4A10A for ; Fri, 18 Jan 2013 02:36:15 +0100 (CET) Received: (qmail 3092 invoked from network); 18 Jan 2013 01:36:13 -0000 Received: from mmarshal3.atlnz.lc (10.32.18.43) by gate-int.alliedtelesyn.co.nz with SMTP; 18 Jan 2013 01:36:13 -0000 Received: from alliedtelesyn.co.nz (Not Verified[10.32.16.32]) by mmarshal3.atlnz.lc with MailMarshal (v7, 1, 0, 4874) id ; Fri, 18 Jan 2013 14:36:10 +1300 Received: from MAIL/SpoolDir by alliedtelesyn.co.nz (Mercury 1.48); 18 Jan 13 13:40:13 +1200 Received: from SpoolDir by MAIL (Mercury 1.48); 18 Jan 13 13:39:53 +1200 Received: from chrisp-dl.ws.atlnz.lc (10.33.22.46) by alliedtelesyn.co.nz (Mercury 1.48) with ESMTP; 18 Jan 13 13:39:49 +1200 Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id E2287208F9; Fri, 18 Jan 2013 14:35:48 +1300 (NZDT) From: Chris Packham To: u-boot@lists.denx.de Date: Fri, 18 Jan 2013 14:35:32 +1300 Message-Id: <1358472932-32083-6-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 1.7.12.rc2.16.g034161a In-Reply-To: <1358472932-32083-1-git-send-email-judge.packham@gmail.com> References: <1358472932-32083-1-git-send-email-judge.packham@gmail.com> Cc: Chris Packham Subject: [U-Boot] [RFC PATCH v2 5/5] common.h: add getenv_IP6addr X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Chris Packham 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 --- 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 2f2578b..41c5fb2 100644 --- a/include/common.h +++ b/include/common.h @@ -833,6 +833,12 @@ static inline IPaddr_t getenv_IPaddr(char *var) return string_to_ip(getenv(var)); } +#include +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 a8de103..44c414f 100644 --- a/lib/net_utils.c +++ b/lib/net_utils.c @@ -27,7 +27,6 @@ */ #include -#include #include IPaddr_t string_to_ip(const char *s)