nzrdhcp: also define lease in offer
This commit is contained in:
parent
693156dc3e
commit
c35d9ccbed
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue