Skip to content

fix: prevent static IP assignment matching subnet gateway#894

Open
kavirakesh14 wants to merge 1 commit into
podman-container-tools:mainfrom
kavirakesh14:fix/netavark-gateway-conflict
Open

fix: prevent static IP assignment matching subnet gateway#894
kavirakesh14 wants to merge 1 commit into
podman-container-tools:mainfrom
kavirakesh14:fix/netavark-gateway-conflict

Conversation

@kavirakesh14
Copy link
Copy Markdown

@kavirakesh14 kavirakesh14 commented Jun 5, 2026

What does this PR do?

This adds a validation step to the Netavark IPAM logic to immediately reject static IP requests that conflict with the subnet's gateway IP.

Previously, if a container was started with a static IP matching the gateway, Netavark would accept it. The container would start successfully but suffer from silent internal networking failures, specifically resulting in "connection refused" errors on internal sockets.

By failing fast inside allocIPs with an "address already in use" error, Podman's behavior now mirrors Docker's standard behavior and prevents this ghost networking state.

Fixes Issue

Fixes podman-container-tools/podman#28863

How was this tested?

  • Compiled containers/common locally and linked it to a fresh build of Podman.
  • Passed local go fmt, go vet, and go test.

@github-actions github-actions Bot added the common Related to "common" package label Jun 5, 2026
This adds validation in Netavark IPAM to mimic Docker's behavior, throwing an 'address already in use' error if a user requests a static IP that is already assigned to the subnet's gateway, preventing silent internal socket connection failures.

Committer: kavirakesh14 <kavirakesh007@gmail.com>
Signed-off-by: kavirakesh14 <kavirakesh007@gmail.com>
@kavirakesh14 kavirakesh14 force-pushed the fix/netavark-gateway-conflict branch from 52e8967 to 9b9daa7 Compare June 5, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socket communication with an IP *.*.*.1 fails

1 participant