summaryrefslogtreecommitdiffstats
path: root/net/bootp.c
diff options
context:
space:
mode:
authorLuuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>2011-05-16 18:29:19 +0000
committerWolfgang Denk <wd@denx.de>2011-07-27 23:20:46 +0200
commit09e3a67dec72b85dfc5535d2dbe695e9b2bfc4f9 (patch)
tree7e7f9ab54d363f59adb838514e49a5fbbfa1351f /net/bootp.c
parent7130a579fdba5dd1bf99508fb0b1d13317542109 (diff)
downloadblackbird-obmc-uboot-09e3a67dec72b85dfc5535d2dbe695e9b2bfc4f9.tar.gz
blackbird-obmc-uboot-09e3a67dec72b85dfc5535d2dbe695e9b2bfc4f9.zip
bootp: add ntpserver option to bootp request
Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Cc: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 4db63cbbe6..45eaab1e05 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 */
OpenPOWER on IntegriCloud