From patchwork Mon May 16 02:24:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 95671 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 D35B0B6EEB for ; Mon, 16 May 2011 12:30:23 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3E62D2812E; Mon, 16 May 2011 04:30:22 +0200 (CEST) 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 Br1rfqE70IL9; Mon, 16 May 2011 04:30:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC79428132; Mon, 16 May 2011 04:30:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 36D2128132 for ; Mon, 16 May 2011 04:30:18 +0200 (CEST) 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 zOUpZv5H-m9L for ; Mon, 16 May 2011 04:30:17 +0200 (CEST) X-Greylist: delayed 305 seconds by postgrey-1.27 at theia; Mon, 16 May 2011 04:30:15 CEST 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 mail-px0-f174.google.com (mail-px0-f174.google.com [209.85.212.174]) by theia.denx.de (Postfix) with ESMTPS id 063B82812E for ; Mon, 16 May 2011 04:30:15 +0200 (CEST) Received: by pxi15 with SMTP id 15so2825087pxi.33 for ; Sun, 15 May 2011 19:30:13 -0700 (PDT) Received: by 10.68.30.36 with SMTP id p4mr4010646pbh.308.1305512708947; Sun, 15 May 2011 19:25:08 -0700 (PDT) Received: from localhost.localdomain (gate1.alliedtelesyn.co.nz [202.49.72.36]) by mx.google.com with ESMTPS id b4sm2975374pbo.80.2011.05.15.19.25.06 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 May 2011 19:25:07 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Mon, 16 May 2011 14:24:41 +1200 Message-Id: <1305512681-8167-1-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305250162-7328-3-git-send-email-judge.packham@gmail.com> References: <1305250162-7328-3-git-send-email-judge.packham@gmail.com> Cc: Luuk Paulussen , biggerbadderben@gmail.com Subject: [U-Boot] [PATCHv2] bootp: add ntpserver option to bootp request X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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: Luuk Paulussen Signed-off-by: Luuk Paulussen Acked-by: Chris Packham Cc: Ben Warren --- Changes since v1: - fixed compile error in BootpVendorProcess when CONFIG_CMD_SNTP is not defined net/bootp.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/net/bootp.c b/net/bootp.c index 4db63cb..18c743e 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -228,6 +228,11 @@ static void BootpVendorFieldProcess (u8 * ext) NetOurNISDomain[size] = 0; } break; +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) + case 42: /* NTP server IP */ + NetCopyIP (&NetNtpServerIP, (IPaddr_t *) (ext + 2)); + break; +#endif /* Application layer fields */ case 43: /* Vendor specific info - Not yet supported */ /* @@ -278,6 +283,11 @@ static void BootpVendorProcess (u8 * ext, int size) if (NetBootFileSize) debug("NetBootFileSize: %d\n", NetBootFileSize); + +#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) + if (NetNtpServerIP) + debug("NetNtpServerIP : %pI4\n", &NetNtpServerIP); +#endif } /* * Handle a BOOTP received packet. @@ -538,6 +548,11 @@ static int BootpExtended (u8 * e) *e++ = 32; e += 32; #endif +#if defined(CONFIG_BOOTP_NTPSERVER) + *e++ = 42; + *e++ = 4; + e += 4; +#endif *e++ = 255; /* End of the list */