Skip to content

Commit 22f059d

Browse files
committed
conf: simplify ipv4 regex
use one matching group rather than 3.
1 parent 86379b4 commit 22f059d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ static HANDLE_FUNC (handle_upstream)
964964
ip = get_string_arg (line, &match[mi]);
965965
if (!ip)
966966
return -1;
967-
mi += 5;
967+
mi += 3;
968968

969969
port = (int) get_long_arg (line, &match[mi]);
970970
mi += 2;

src/conf_regex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define ALNUM "([-A-Za-z0-9._]+)"
1717
#define USERNAME "([^:]*)"
1818
#define PASSWORD "([^@]*)"
19-
#define IP "((([0-9]{1,3})\\.){3}[0-9]{1,3})"
19+
#define IP "([0-9]+[.][0-9]+[.][0-9]+[.][0-9]+)"
2020
#define IPMASK "(" IP "(/" DIGIT "+)?)"
2121
#define IPV6 "(" \
2222
"(([0-9a-fA-F:]{2,39}))|" \

0 commit comments

Comments
 (0)