Merge pull request #2104 from glaeqen/slow-dhcp

net: Reset DHCP socket when the link up is detected
This commit is contained in:
Dario Nieuwenhuis 2023-10-23 09:55:17 +00:00 committed by GitHub
commit 64ab23d17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -860,6 +860,9 @@ impl<D: Driver> Inner<D> {
let socket = s.sockets.get_mut::<dhcpv4::Socket>(dhcp_handle); let socket = s.sockets.get_mut::<dhcpv4::Socket>(dhcp_handle);
if self.link_up { if self.link_up {
if old_link_up != self.link_up {
socket.reset();
}
match socket.poll() { match socket.poll() {
None => {} None => {}
Some(dhcpv4::Event::Deconfigured) => { Some(dhcpv4::Event::Deconfigured) => {