diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-06-05 18:38:03 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-06-05 22:06:59 -0600 |
commit | 3f166bcbd7f0e1060eecdce643c025db425ae81d (patch) | |
tree | 188ae6201d971b01f5748390e9c92ba50a6382a2 /ui/syntax | |
parent | conf: add support for search domains inside dns line (diff) | |
download | wireguard-windows-3f166bcbd7f0e1060eecdce643c025db425ae81d.tar.xz wireguard-windows-3f166bcbd7f0e1060eecdce643c025db425ae81d.zip |
syntax: update to latest from wireguard-tools, for dns search domains
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/syntax')
-rw-r--r-- | ui/syntax/highlighter.c | 12 | ||||
-rw-r--r-- | ui/syntax/highlighter.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ui/syntax/highlighter.c b/ui/syntax/highlighter.c index e0d4e04e..d89feda1 100644 --- a/ui/syntax/highlighter.c +++ b/ui/syntax/highlighter.c @@ -337,11 +337,6 @@ static bool is_valid_network(string_span_t s) return is_valid_ipv4(s) || is_valid_ipv6(s); } -static bool is_valid_dns(string_span_t s) -{ - return is_valid_ipv4(s) || is_valid_ipv6(s); -} - enum field { InterfaceSection, PrivateKey, @@ -451,7 +446,12 @@ static void highlight_multivalue_value(struct highlight_span_array *ret, const s { switch (section) { case DNS: - append_highlight_span(ret, parent.s, s, is_valid_dns(s) ? HighlightIP : HighlightError); + if (is_valid_ipv4(s) || is_valid_ipv6(s)) + append_highlight_span(ret, parent.s, s, HighlightIP); + else if (is_valid_hostname(s)) + append_highlight_span(ret, parent.s, s, HighlightHost); + else + append_highlight_span(ret, parent.s, s, HighlightError); break; case Address: case AllowedIPs: { diff --git a/ui/syntax/highlighter.h b/ui/syntax/highlighter.h index c6c8b5d5..0a86de78 100644 --- a/ui/syntax/highlighter.h +++ b/ui/syntax/highlighter.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + * Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ #include <sys/types.h> |