[U-Boot] [PATCH 3/3] bootp: add ntpserver option to bootp request

Chris Packham judge.packham at gmail.com
Fri May 13 03:27:27 CEST 2011


From: Luuk Paulussen <luuk.paulussen at alliedtelesis.co.nz>

Signed-off-by: Luuk Paulussen <luuk.paulussen at alliedtelesis.co.nz>
Acked-by: Chris Packham <chris.packham at alliedtelesis.co.nz>
Cc: Ben Warren <biggerbadderben at gmail.com>
---
 net/bootp.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index 4db63cb..53f37d0 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,9 @@ static void BootpVendorProcess (u8 * ext, int size)
 
 	if (NetBootFileSize)
 		debug("NetBootFileSize: %d\n", NetBootFileSize);
+
+	if (NetNtpServerIP)
+		debug("NetNtpServerIP : %pI4\n", &NetNtpServerIP);
 }
 /*
  *	Handle a BOOTP received packet.
@@ -538,6 +546,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 */
 
-- 
1.7.4.1



More information about the U-Boot mailing list