print IPv6 %any hosts as %any6
authorMartin Willi <martin@strongswan.org>
Thu, 19 Mar 2009 09:04:20 +0000 (09:04 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 19 Mar 2009 09:04:20 +0000 (09:04 -0000)
src/libstrongswan/utils/host.c

index e11017c..6a6a490 100644 (file)
@@ -119,7 +119,8 @@ int host_printf_hook(char *dst, size_t dstlen, printf_hook_spec_t *spec,
        }
        else if (is_anyaddr(this))
        {
-               snprintf(buffer, sizeof(buffer), "%%any");
+               snprintf(buffer, sizeof(buffer), "%%any%s",
+                                this->address.sa_family == AF_INET6 ? "6" : "");
        }
        else
        {