aboutsummaryrefslogtreecommitdiff
path: root/slirp/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/socket.h')
-rw-r--r--slirp/socket.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/slirp/socket.h b/slirp/socket.h
index c4afc9494f..e9c9b053dc 100644
--- a/slirp/socket.h
+++ b/slirp/socket.h
@@ -34,17 +34,23 @@ struct socket {
union { /* foreign host */
struct sockaddr_storage ss;
struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
} fhost;
#define so_faddr fhost.sin.sin_addr
#define so_fport fhost.sin.sin_port
+#define so_faddr6 fhost.sin6.sin6_addr
+#define so_fport6 fhost.sin6.sin6_port
#define so_ffamily fhost.ss.ss_family
union { /* local host */
struct sockaddr_storage ss;
struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
} lhost;
#define so_laddr lhost.sin.sin_addr
#define so_lport lhost.sin.sin_port
+#define so_laddr6 lhost.sin6.sin6_addr
+#define so_lport6 lhost.sin6.sin6_port
#define so_lfamily lhost.ss.ss_family
uint8_t so_iptos; /* Type of service */
@@ -102,6 +108,13 @@ static inline int sockaddr_equal(struct sockaddr_storage *a,
return a4->sin_addr.s_addr == b4->sin_addr.s_addr
&& a4->sin_port == b4->sin_port;
}
+ case AF_INET6:
+ {
+ struct sockaddr_in6 *a6 = (struct sockaddr_in6 *) a;
+ struct sockaddr_in6 *b6 = (struct sockaddr_in6 *) b;
+ return (in6_equal(&a6->sin6_addr, &b6->sin6_addr)
+ && a6->sin6_port == b6->sin6_port);
+ }
default:
g_assert_not_reached();
}