diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2017-02-07 18:26:54 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2017-02-07 18:26:54 +0100 |
commit | 371de55728931fc253763328ae322ce9512afba1 (patch) | |
tree | 070400e399c0dd45bf6d4cdfa1f1f1341c0e7c01 /util.c | |
parent | 70ff9183e5533d6f0bfccf20bb67ac18d0bbb493 (diff) |
llmnrd: compare full hostname in query, fix off-by-one error
When checking whether the hostname matches, llmnrd does not consider the
last character of the hostnames, leading to the following incorrect
behavior:
$ ./llmnrd -H foobar
Starting llmnrd on port 5355, hostname foobar
...
$ ./llmnr-query foobaZ
LLMNR query: foobaZ IN ANY
LLMNR response: foobar IN A 10.42.0.42 (TTL 30)
Fix it by considering the full hostname. Also do only convert alphabetic
characters to lowercase using tolower(3), since its behavior is
undefined for any other characters.
Fixes #21
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'util.c')
0 files changed, 0 insertions, 0 deletions