From eae303ff23f51259eddc8856c71453d887ffe51a Mon Sep 17 00:00:00 2001 From: Guillaume Subiron Date: Sat, 19 Dec 2015 22:24:58 +0100 Subject: slirp: Make Socket structure IPv6 compatible This patch replaces foreign and local address/port couples in Socket structure by 2 sockaddr_storage which can be casted in sockaddr_in. Direct access to address and port is still possible thanks to some \#define, so retrocompatibility of the existing code is assured. The ss_family field of sockaddr_storage is declared after each socket creation. The whole structure is also saved/restored when a Qemu session is saved/restored. This prepares for IPv6 support. Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault Reviewed-by: Thomas Huth Signed-off-by: Jason Wang --- slirp/tcp_input.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'slirp/tcp_input.c') diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c index 6b096ecb3c..4c3191d4fd 100644 --- a/slirp/tcp_input.c +++ b/slirp/tcp_input.c @@ -374,8 +374,10 @@ findso: sbreserve(&so->so_snd, TCP_SNDSPACE); sbreserve(&so->so_rcv, TCP_RCVSPACE); + so->so_lfamily = AF_INET; so->so_laddr = ti->ti_src; so->so_lport = ti->ti_sport; + so->so_ffamily = AF_INET; so->so_faddr = ti->ti_dst; so->so_fport = ti->ti_dport; -- cgit v1.2.3-55-g7522