nzrdhcp: also define lease in offer

This commit is contained in:
snow flurry 2024-08-15 19:15:25 -07:00
parent 693156dc3e
commit c35d9ccbed

View file

@ -78,12 +78,15 @@ async fn handle_message(ctx: &Context, from: SocketAddr, msg: &Message) {
let mut nak = false;
let mut response = match msg_type {
MessageType::Discover => make_reply(
msg,
MessageType::Offer,
Some(instance.lease.addr.addr),
true,
),
MessageType::Discover => {
lease_time = Some(DEFAULT_LEASE);
make_reply(
msg,
MessageType::Offer,
Some(instance.lease.addr.addr),
true,
)
}
MessageType::Request => {
if let Some(DhcpOption::RequestedIpAddress(addr)) =
msg.opts().get(OptionCode::RequestedIpAddress)