Modify the behaviour of --synth-domain for IPv6.

When deriving a domain name from an IPv6 address, an address
such as 1234:: would become 1234--.example.com, which is
not legal in IDNA2008. Stop using the :: compression method,
so 1234:: becomes
1234-0000-0000-0000-0000-0000-0000-0000.example.com
This commit is contained in:
Simon Kelley committed 2024-11-27 23:12:41 +00:00
1 parent 41d2ae3203
commit a8088e331a
4 files changed
+33 -43

No files matched your search

+4 -1
View File
@@ -2636,8 +2636,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
{
if (option != 's')
{
/* IPv6 address is longest and represented as
xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
which is 39 chars */
if (!(new->prefix = canonicalise_opt(arg)) ||
strlen(new->prefix) > MAXLABEL - INET_ADDRSTRLEN)
strlen(new->prefix) > (MAXLABEL - 39))
ret_err_free(_("bad prefix"), new);
}
else if (strcmp(arg, "local") != 0)