diff --git a/gio/ginetaddress.c b/gio/ginetaddress.c index fbf32dfee..c5274a0f5 100644 --- a/gio/ginetaddress.c +++ b/gio/ginetaddress.c @@ -425,6 +425,10 @@ g_inet_address_init (GInetAddress *address) * * Parses @string as an IP address and creates a new #GInetAddress. * + * If @address is an IPv6 address, it can also contain a scope ID + * (separated from the address by a `%`). Note that currently this + * behavior is platform specific. This may change in a future release. + * * Returns: (nullable) (transfer full): a new #GInetAddress corresponding * to @string, or %NULL if @string could not be parsed. * Free the returned object with g_object_unref(). diff --git a/gio/ginetsocketaddress.c b/gio/ginetsocketaddress.c index ca03890f6..95a4eb164 100644 --- a/gio/ginetsocketaddress.c +++ b/gio/ginetsocketaddress.c @@ -402,7 +402,8 @@ g_inet_socket_address_new (GInetAddress *address, * Creates a new #GInetSocketAddress for @address and @port. * * If @address is an IPv6 address, it can also contain a scope ID - * (separated from the address by a `%`). + * (separated from the address by a `%`). Note that currently this + * behavior is platform specific. This may change in a future release. * * Returns: (nullable) (transfer full): a new #GInetSocketAddress, * or %NULL if @address cannot be parsed. diff --git a/gio/tests/inet-address.c b/gio/tests/inet-address.c index f43640ca8..ea9faecd8 100644 --- a/gio/tests/inet-address.c +++ b/gio/tests/inet-address.c @@ -53,9 +53,11 @@ test_parse (void) addr = g_inet_address_new_from_string ("204.152.189.116"); g_assert (addr != NULL); g_object_unref (addr); +#ifndef G_OS_WIN32 addr = g_inet_address_new_from_string ("::1%0"); g_assert (addr != NULL); g_object_unref (addr); +#endif addr = g_inet_address_new_from_string ("::1::2"); g_assert (addr == NULL); @@ -209,11 +211,12 @@ test_socket_address (void) g_object_unref (saddr); - addr = g_inet_address_new_from_string ("::1%25"); + addr = g_inet_address_new_from_string ("::1"); saddr = G_INET_SOCKET_ADDRESS (g_object_new (G_TYPE_INET_SOCKET_ADDRESS, "address", addr, "port", 308, "flowinfo", 10, + "scope-id", 25, NULL)); g_object_unref (addr);