X-Git-Url: http://git.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv4.c;fp=src%2Fdhcpv4.c;h=f0780876ebbe47c71a71a6d460fa9084508c2e44;hp=a3b0e33c7540df34af8a0b4c2c6e5ff54366df0d;hb=860ca900e41c5d0f98cc85e67b39977f6f2cb355;hpb=83e14f45581757a4ea1418a64d80885c79db5ef0 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);