Skip to content
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

Add support for IPv6 port binding #5715

Closed
Perflyst opened this issue Apr 4, 2020 · 13 comments · Fixed by #6529
Closed

Add support for IPv6 port binding #5715

Perflyst opened this issue Apr 4, 2020 · 13 comments · Fixed by #6529
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@Perflyst
Copy link

Perflyst commented Apr 4, 2020

/kind feature

Description

Would be nice to be able to bind ports to IPv6 addresses like with IPv4. In Docker works both.

Describe the results you expected:

podman pod create --name=test --share net -p 2000:0000:60:1244::2:80:80/tcp should work without an error like

Error: unable to create pod: Invalid ip address 2000:0000:60:1244::2: address 2000:0000:60:1244::2:: too many colons in address

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 4, 2020
@rhatdan
Copy link
Member

rhatdan commented Apr 5, 2020

@mccv1r0 @mheon Would this work, if we were not parsing the address so strictly?

@mheon
Copy link
Member

mheon commented Apr 5, 2020

I think we'll need to make a separate copy of each port for v4 and v6 when we add ports.

@mheon
Copy link
Member

mheon commented Apr 5, 2020

Oh, hmmmm. This isn't by default, but only when a v6 address is specified.

Yeah, I think @rhatdan is right - this is too-aggressive parsing of the address to try and ensure it's an IPv4

@mheon
Copy link
Member

mheon commented Apr 5, 2020

Also - does that command you gave work in Docker? Because I'm 90% sure that specifying port numbers after an IPv6 address using an extra : is wrong...

@Perflyst
Copy link
Author

Perflyst commented Apr 5, 2020

Yup, I was confused in the beginning too but it does not work with [ ] (brackets) and you need to do it like this.

@github-actions
Copy link

github-actions bot commented May 6, 2020

A friendly reminder that this issue had no activity for 30 days.

@aleks-mariusz
Copy link
Contributor

to bump this and follow up, so specifying the ipv6 address not like the typical [2001:db8::] is how it does work with docker or with podman?

just as a note, that is counter to how every other utility that supports ipv6 works (the brackets are required to delimit where the address ends and where the port is to be specified..

@mheon
Copy link
Member

mheon commented May 7, 2020

I think we're going to have to retain support for the strange and nonstandard Docker parsing, but we can at least add support for standard IPv6 parsing at the same time.

@github-actions
Copy link

github-actions bot commented Jun 7, 2020

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jun 8, 2020

@mheon Any movement on this? Issue for Interns?

@mheon
Copy link
Member

mheon commented Jun 8, 2020

Just finished up on it now

@mheon
Copy link
Member

mheon commented Jun 8, 2020

Fixed by #5715

@mheon
Copy link
Member

mheon commented Jun 8, 2020

Sorry, bu #6529

mheon added a commit to mheon/libpod that referenced this issue Jun 10, 2020
Two areas needed tweaking to accomplish this: port parsing and
binding ports on the host.

Parsing is an obvious problem - we have to accomodate an IPv6
address enclosed by [] as well as a normal IPv4 address. It was
slightly complicated by the fact that we previously just counted
the number of colons in the whole port definition (a thousand
curses on whoever in the IPv6 standard body decided to reuse
colons for address separators), but did not end up being that
bad.

Libpod also (optionally) binds ports on the host to prevent their
reuse by host processes. This code was IPv4 only for TCP, and
bound to both for UDP (which I'm fairly certain is not correct,
and has been adjusted). This just needed protocols adjusted to
read "tcp4"/"tcp6" and "udp4"/"udp6" based on what we wanted to
bind to.

Fixes containers#5715

Signed-off-by: Matthew Heon <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants