Skip to content

Support IPv6 in address assignment and gateway #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexeyPerevalov
Copy link

Rootlesskit assigns ipv4 address and routes for ipv4, but not for ipv6, this PR address IPv6 issue.

Some tools like slirp4netns could assign ip address, routes, but rootlesskit doesn't request them to do it.

Couple clues:

  1. Interface address and gateway should be received from e.g. slirp4netns. There is already a comment on it in code. Need to fix slirp4netns and others.
  2. Setting static IPv6 address fd00::1 to tap0 looks weired, since e.g. slirp4netns already could give dynamic address from fd00::/64 network, but there is a race. Rootlesskit can't set default route via fd00::2 unless IPv6 address and route from fd00::/64 is set to tap0.

Several clues:
1. Interface address and gateway should be received from e.g.
   slirp4netns. There is already a comment on it in code. Need to fix
slirp4netns and others.
2. Setting static IPv6 address fd00::1 to tap0 looks weired, since
e.g. slirp4netns already could give dynamic address from fd00::/64
network, but there is a race. Rootlesskit can't set default route
via fd00::2 unless IPv6 address and route from fd00::/64 is set to
tap0

Signed-off-by: Alexey Perevalov <[email protected]>
@AkihiroSuda AkihiroSuda added this to the v2.3.5 milestone Apr 12, 2025
)

func PrepareTap(childPID int, childNetNsPath string, tap string) error {
logrus.Debugf("PrepareTap")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debug message doesn't seem meaningful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. I'll remove this debug leftover.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping

@AkihiroSuda
Copy link
Member

Can we have a test?

@AlexeyPerevalov
Copy link
Author

AlexeyPerevalov commented Apr 15, 2025

Can we have a test?

yes, I'll add test. Did you mean these tests in hack/*

@AkihiroSuda
Copy link
Member

Can we have a test?

yes, I'll add test. Did you mean these tests in hack/*

Yes, thanks

@AkihiroSuda AkihiroSuda modified the milestones: v2.3.5, v2.3.6 May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants