mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
ipv6_v4mapped: force pass even if we don't speak IPv4
Some OS (e.g. OpenBSD) do not implement IP v4-mapped addresses. When this is the case, then we get a "Connection refused", so force the test to pass to that further tests can run. https://bugzilla.gnome.org/show_bug.cgi?id=686058
This commit is contained in:
parent
615b44c7ca
commit
cb1876b4a7
@ -105,6 +105,12 @@ create_server (GSocketFamily family,
|
||||
fd = g_socket_get_fd (server);
|
||||
v6_only = 0;
|
||||
setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &v6_only, sizeof (v6_only));
|
||||
if (! g_socket_speaks_ipv4 (data->server))
|
||||
{
|
||||
g_object_unref (data->server);
|
||||
g_slice_free (IPTestData, data);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -548,6 +554,12 @@ test_ipv6_v4mapped (void)
|
||||
|
||||
data = create_server (G_SOCKET_FAMILY_IPV6, v4mapped_server_thread, TRUE);
|
||||
|
||||
if (data == NULL)
|
||||
{
|
||||
g_test_message ("Test not run: not supported by the OS");
|
||||
return;
|
||||
}
|
||||
|
||||
client = g_socket_new (G_SOCKET_FAMILY_IPV4,
|
||||
G_SOCKET_TYPE_STREAM,
|
||||
G_SOCKET_PROTOCOL_DEFAULT,
|
||||
|
Loading…
Reference in New Issue
Block a user