You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dhcp): Send DHCPRELEASE on container teardown
When a container using DHCP is torn down, its lease is left active on the
DHCP server until it expires. This can be problematic in environments
with small IP pools or long lease times. In setups using Dynamic DNS (DDNS),
it can also lead to stale DNS records.
This change introduces the capability for netavark to send a DHCPRELEASE
message to the DHCP server when a container's network is torn down.
This is implemented by:
- Adding a `release_lease` method to the `DhcpV4Service` in `dhcp_service.rs`,
which wraps the `release` function from the underlying mozim client.
- Modifying the `teardown` gRPC handler in `dhcp_proxy.rs` to create a
temporary `DhcpV4Service` instance, retrieve the lease from the cache,
and call the new `release_lease` method in a "best-effort" manner.
0 commit comments