Skip to content

inte/t/networking: delete veth ifaces before netns#48749

Merged
akerouanton merged 1 commit intomoby:masterfrom
akerouanton:fix-L3Segment-Destroy
Oct 25, 2024
Merged

inte/t/networking: delete veth ifaces before netns#48749
akerouanton merged 1 commit intomoby:masterfrom
akerouanton:fix-L3Segment-Destroy

Conversation

@akerouanton
Copy link
Copy Markdown
Member

- What I did

When a netns is deleted while there's still veth interfaces in it, the kernel delete both ends of the veth pairs. The veth interface living in that netns will be deleted instantaneously, but the other end will be reclaimed after a short delay.

If, in the meantime, a new test is spun up, and tries to create a new veth pair with the same peer name, the kernel will return -EEXIST.

But, if the veth pair is explicitly deleted before the netns, then both veth ends will be deleted instantaneously.

Hence, we need to do just that here.

- How to verify it

This was manually tested on #48721 with: TESTFLAGS='-test.run (TestAccessPublishedPortFromNonMatchingIface|TestAccessPublishedPortFromRemoteHost)'.

@akerouanton akerouanton added this to the 28.0.0 milestone Oct 24, 2024
@akerouanton akerouanton requested a review from robmry October 24, 2024 16:23
@akerouanton akerouanton self-assigned this Oct 24, 2024
@akerouanton akerouanton merged commit 025c84b into moby:master Oct 25, 2024
@akerouanton akerouanton deleted the fix-L3Segment-Destroy branch October 25, 2024 07:55
@Tinabates

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants