1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

connect: Added and improved regex for ip detection.

Thanks to Norbert Kiesel, rlo#14.
This commit is contained in:
Andreas Schneider
2010-12-29 20:44:07 +01:00
parent 296767afc4
commit 1267240810

View File

@@ -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;