mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
wireaddr: is_dnsaddr allow underscore in hostname
The hostname part of a DNS FQDN can allow for additional characters other than specified in `man 7 hostname`. This extends is_dnsaddr and the test issue #5657. Also fixes a typo in a comment. Changelog-Fixed: wireaddr: #5657 allow '_' underscore in hostname part of DNS FQDN
This commit is contained in:
committed by
Christian Decker
parent
a96ff3b097
commit
29f81baac9
@@ -126,11 +126,14 @@ int main(int argc, char *argv[])
|
||||
assert(is_dnsaddr("123example.com"));
|
||||
assert(is_dnsaddr("example123.com"));
|
||||
assert(is_dnsaddr("is-valid.3hostname123.com"));
|
||||
assert(is_dnsaddr("just-a-hostname-with-dashes"));
|
||||
assert(is_dnsaddr("lightningd_dest.underscore.allowed.in.hostname.part.com"));
|
||||
assert(!is_dnsaddr("UPPERCASE.invalid.com"));
|
||||
assert(!is_dnsaddr("-.invalid.com"));
|
||||
assert(!is_dnsaddr("invalid.-example.com"));
|
||||
assert(!is_dnsaddr("invalid.example-.com"));
|
||||
assert(!is_dnsaddr("invalid..example.com"));
|
||||
assert(!is_dnsaddr("underscore.not.allowed.in.domain_name.com"));
|
||||
|
||||
/* Grossly invalid. */
|
||||
assert(!separate_address_and_port(tmpctx, "[", &ip, &port));
|
||||
|
||||
Reference in New Issue
Block a user