-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
[Feature Request]Support collapsed zeroes format for ipv6 host addresses (i.e. ::1 for 0:0:0:0:0:0:0:1) #537
Comments
So OpenSSH decided not to support ipv6 addresses with ports specified in the host positional argument. However, it is standard, particularly if there is a
I'm leaning towards the first option (particularly since OpenSsh makes you pass The 2nd option is complicated and hard to document in the small Remember that the port specified by the host positional arg or the EDIT: Yuck, the shell will require that you quote your argument if you pass square brackets for an ipv6 address. Maybe I'm leaning towards option 3 :). Or maybe a hybrid of option 2 where if you pass an ipv6 address with |
Help output: ``` $> ./et --help Remote shell for the busy and impatient Usage: et [OPTION...] [user@]host[:port] Note that 'host' can be a hostname or ipv4 address with or without a port or an ipv6 address. If the ipv6 address is abbreviated with :: then it must be specfied without a port (use -p,--port). -h, --help Print help --version Print version -u, --username Username --host arg Remote host name ... ``` Tests: ``` $> ./et ::1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1:8080 --macserver $> ./et ::1 -p 8080 --macserver # fails because defaults to port 2022 ``` Fixes MisterTea#537
This will support ipv6 addresses that are abbreviated with `::` such as ::1 (for 0:0:0:0:0:0:0:1) with some caveats around specifying the port in the host positional argument. Help output: ``` $> ./et --help Remote shell for the busy and impatient Usage: et [OPTION...] [user@]host[:port] Note that 'host' can be a hostname or ipv4 address with or without a port or an ipv6 address. If the ipv6 address is abbreviated with :: then it must be specfied without a port (use -p,--port). -h, --help Print help --version Print version -u, --username Username --host arg Remote host name ... ``` Tests: ``` $> ./et ::1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1:8080 --macserver $> ./et ::1 -p 8080 --macserver # fails because defaults to port 2022 ``` Fixes MisterTea#537
This will support ipv6 addresses that are abbreviated with `::` such as ::1 (for 0:0:0:0:0:0:0:1) with some caveats around specifying the port in the host positional argument. Help output: ``` $> ./et --help Remote shell for the busy and impatient Usage: et [OPTION...] [user@]host[:port] Note that 'host' can be a hostname or ipv4 address with or without a port or an ipv6 address. If the ipv6 address is abbreviated with :: then it must be specfied without a port (use -p,--port). -h, --help Print help --version Print version -u, --username Username --host arg Remote host name ... ``` Tests: ``` $> ./et ::1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1 -p 8080 --macserver $> ./et 0:0:0:0:0:0:0:1:8080 --macserver $> ./et ::1 -p 8080 --macserver # fails because defaults to port 2022 ``` Fixes #537
Now that the et terminal client supports ipv6 host positional args (with or without port specified), we should move the host argument parsing logic out of main() into a helper that has more powerful ipv6 parsing logic (not just counting 7 colons or 8 colons if a port is specified.
ipv4 ip or hostname will have at most 1 colon (if a port is specified).
ipv6 ip will have at least 2 colons (for a collapsed form with no port specified) and up to 8 if the address is fully expressed and a port is specified.
Ex:
The text was updated successfully, but these errors were encountered: