diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-05-10 12:40:49 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-05-10 12:40:49 +0200 |
commit | c0b68d2eafaf2b44df9377ba0844bc315163247e (patch) | |
tree | 9b08a7fd3375191f05130d238044af0d83a5c1dd /src/wg-quick/android.c | |
parent | reresolve-dns: use $EPOCHSECONDS instead of $(date +%s) (diff) | |
download | wireguard-tools-c0b68d2eafaf2b44df9377ba0844bc315163247e.tar.xz wireguard-tools-c0b68d2eafaf2b44df9377ba0844bc315163247e.zip |
wg-quick: android: use right regex for host-vs-IP
Looks like the "is valid ifname" regex was copy and pasted from
wg-quick.bash instead of the "is valid IP" regex.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | src/wg-quick/android.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wg-quick/android.c b/src/wg-quick/android.c index a5a789a..1263ee4 100644 --- a/src/wg-quick/android.c +++ b/src/wg-quick/android.c @@ -855,7 +855,7 @@ static void set_dnses(unsigned int netid, const char *dnses) if (!len) return; - xregcomp(®ex_ipnothost, "^[a-zA-Z0-9_=+.-]{1,15}$", REG_EXTENDED | REG_NOSUB); + xregcomp(®ex_ipnothost, "(^[0-9.]+$)|(^.*:.*$)", REG_EXTENDED | REG_NOSUB); for (char *dns = strtok(mutable, ", \t\n"); dns; dns = strtok(NULL, ", \t\n")) { if (strchr(dns, '\'') || strchr(dns, '\\')) continue; |