From b6b0e5da1385478db04f5def1cdb870dd628aceb Mon Sep 17 00:00:00 2001 From: Radoslaw Olko Date: Wed, 16 Jan 2019 22:50:47 +0100 Subject: [PATCH] added lease time option to dhcpserver's DHCPOFFER --- extras/dhcpserver/dhcpserver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extras/dhcpserver/dhcpserver.c b/extras/dhcpserver/dhcpserver.c index a9a6f93..428ec8e 100644 --- a/extras/dhcpserver/dhcpserver.c +++ b/extras/dhcpserver/dhcpserver.c @@ -254,6 +254,9 @@ static void handle_dhcp_discover(struct dhcp_msg *dhcpmsg) opt = add_dhcp_option_bytes(opt, DHCP_OPTION_DNS_SERVER, &state->dns, 4); } + uint32_t expiry = htonl(DHCPSERVER_LEASE_TIME); + opt = add_dhcp_option_bytes(opt, DHCP_OPTION_LEASE_TIME, &expiry, 4); + opt = add_dhcp_option_bytes(opt, DHCP_OPTION_END, NULL, 0); struct netbuf *netbuf = netbuf_new();