summaryrefslogtreecommitdiff
path: root/llmnr.c
diff options
context:
space:
mode:
Diffstat (limited to 'llmnr.c')
-rw-r--r--llmnr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/llmnr.c b/llmnr.c
index 64fcabd..0b35ae7 100644
--- a/llmnr.c
+++ b/llmnr.c
@@ -61,9 +61,15 @@ static bool llmnr_name_matches(const uint8_t *query)
if (query[1 + n] != 0)
return false;
- for (i = 1; i < llmnr_hostname[0]; i++)
- if (tolower(query[i]) != tolower(llmnr_hostname[i]))
+ for (i = 1; i <= n; i++) {
+ char a = query[i];
+ char b = llmnr_hostname[i];
+ a = isalpha(a) ? tolower(a) : a;
+ b = isalpha(b) ? tolower(b) : b;
+ if (a != b) {
return false;
+ }
+ }
return true;
}