Merge pull request #693 from ja2142/master

added lease time option to dhcpserver's DHCPOFFER
This commit is contained in:
Ruslan V. Uss 2019-01-17 04:37:42 +05:00 committed by GitHub
commit bbc22571ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();