mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 23:43:39 +02:00
GInetSocketAddress: add IPv6 flowinfo and scope_id fields
struct sin6_addr has two additional fields that struct sin_addr doesn't. Add support for those to GInetSocketAddress, and make sure they don't get lost when converting between glib and native types. https://bugzilla.gnome.org/show_bug.cgi?id=635554
This commit is contained in:
@@ -256,7 +256,12 @@ g_socket_address_new_from_native (gpointer native,
|
||||
iaddr = g_inet_address_new_from_bytes ((guint8 *) &(addr->sin6_addr), AF_INET6);
|
||||
}
|
||||
|
||||
sockaddr = g_inet_socket_address_new (iaddr, g_ntohs (addr->sin6_port));
|
||||
sockaddr = g_object_new (G_TYPE_INET_SOCKET_ADDRESS,
|
||||
"address", iaddr,
|
||||
"port", g_ntohs (addr->sin6_port),
|
||||
"flowinfo", g_ntohl (addr->sin6_flowinfo),
|
||||
"scope_id", g_ntohl (addr->sin6_scope_id),
|
||||
NULL);
|
||||
g_object_unref (iaddr);
|
||||
return sockaddr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user