aboutsummaryrefslogtreecommitdiff
path: root/src/connect.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-12-29 20:44:07 +0100
committerAndreas Schneider <asn@cynapses.org>2010-12-29 20:44:07 +0100
commit126724081043880b647b7bb3974e136230b79d0c (patch)
treeed41867e27dff86d15ca0e8f7820c9ef9d047a2b /src/connect.c
parent296767afc466caa4a6b7e618e29ff74ec0c744c3 (diff)
downloadlibssh-126724081043880b647b7bb3974e136230b79d0c.tar.gz
libssh-126724081043880b647b7bb3974e136230b79d0c.tar.xz
libssh-126724081043880b647b7bb3974e136230b79d0c.zip
connect: Added and improved regex for ip detection.
Thanks to Norbert Kiesel, rlo#14.
Diffstat (limited to 'src/connect.c')
-rw-r--r--src/connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/connect.c b/src/connect.c
index 20322c0b..5d04b3fa 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -122,7 +122,7 @@ void ssh_sock_set_blocking(socket_t sock) {
#endif /* _WIN32 */
#ifdef HAVE_REGCOMP
-#define IPEXPR "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$"
+#define IPEXPR "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
static regex_t *ip_regex = NULL;