summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcpv4.c')
-rw-r--r--src/dhcpv4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dhcpv4.c b/src/dhcpv4.c
index a3b0e33..f078087 100644
--- a/src/dhcpv4.c
+++ b/src/dhcpv4.c
@@ -849,6 +849,14 @@ void dhcpv4_handle_msg(void *addr, void *data, size_t len,
dhcpv4_put(&reply, &cookie, DHCPV4_OPT_DNSSERVER,
4 * iface->dhcpv4_dns_cnt, iface->dhcpv4_dns);
+ if (a->reqopts && iface->dhcpv4_ntp_cnt != 0) {
+ for(size_t opts = 0; a->reqopts[opts]; opts++) {
+ if (a->reqopts[opts] == DHCPV4_OPT_NTPSERVER) {
+ dhcpv4_put(&reply, &cookie, DHCPV4_OPT_NTPSERVER,
+ 4 * iface->dhcpv4_ntp_cnt, iface->dhcpv4_ntp);
+ }
+ }
+ }
dhcpv4_put(&reply, &cookie, DHCPV4_OPT_END, 0, NULL);