dhcp: handle NAK packets

This commit is contained in:
Dario Nieuwenhuis 2021-04-07 01:32:04 +02:00
parent 0d53163c55
commit cb075bfc16
1 changed files with 6 additions and 0 deletions

View File

@ -206,6 +206,9 @@ impl Dhcpv4Socket {
});
}
}
(ClientState::Requesting(_), DhcpMessageType::Nak) => {
self.reset();
}
(ClientState::Renewing(state), DhcpMessageType::Ack) => {
if let Some((config, renew_at, expires_at)) = Self::parse_ack(now, ip_repr, &dhcp_repr) {
state.renew_at = renew_at;
@ -216,6 +219,9 @@ impl Dhcpv4Socket {
}
}
}
(ClientState::Renewing(_), DhcpMessageType::Nak) => {
self.reset();
}
_ => {
net_debug!("DHCP ignoring {:?}: unexpected in current state", dhcp_repr.message_type);
}