Skip to content

Commit

Permalink
Allow connecting to IPv6 Link-local addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
akanouras authored and kruton committed Jun 4, 2024
1 parent d98768f commit 4533e3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/connectbot/transport/SSH.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public SSH(HostBean host, TerminalBridge bridge, TerminalManager manager) {
private final static int AUTH_TRIES = 20;

private static final Pattern hostmask = Pattern.compile(
"^(.+)@(([0-9a-z._-]+)|(\\[[a-f:0-9]+\\]))(:(\\d+))?$", Pattern.CASE_INSENSITIVE);
"^(.+)@((?:[0-9a-z._-]+)|(?:\\[[a-f:0-9]+(?:%[-_.a-z0-9]+)?\\]))(?::(\\d+))?$", Pattern.CASE_INSENSITIVE);

private boolean compression = false;
private volatile boolean authenticated = false;
Expand Down Expand Up @@ -789,7 +789,7 @@ public static Uri getUri(String input) {
.append('@')
.append(Uri.encode(matcher.group(2)));

String portString = matcher.group(6);
String portString = matcher.group(3);
int port = DEFAULT_PORT;
if (portString != null) {
try {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/connectbot/transport/Telnet.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class Telnet extends AbsTransport {

static final Pattern hostmask;
static {
hostmask = Pattern.compile("^([0-9a-z._-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE);
hostmask = Pattern.compile("^((?:[0-9a-z._-]+)|(?:\\[[a-f:0-9]+(?:%[-_.a-z0-9]+)?\\]))(?::(\\d+))?$", Pattern.CASE_INSENSITIVE);
}

public Telnet() {
Expand Down Expand Up @@ -271,7 +271,7 @@ public static Uri getUri(String input) {
.append("://")
.append(matcher.group(1));

String portString = matcher.group(3);
String portString = matcher.group(2);
int port = DEFAULT_PORT;
if (portString != null) {
try {
Expand Down

0 comments on commit 4533e3f

Please sign in to comment.