aboutsummaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorNicholas Ngai <nicholas@ngai.me>2021-11-29 16:22:00 -0800
committerNicholas Ngai <nicholas@ngai.me>2021-11-29 16:22:00 -0800
commitbdcd7db57a8d3dbbb6c59cff00aa922d71cd7728 (patch)
treeb63a07000aafc10fa5fedc11e1a8f15372de6022 /src/socket.c
parentd2eb3b45aae71b3831fbf658d18b78b53eba23f9 (diff)
parent5bf953e2f92d5c426c2a6b5db5e95b6bdf1f439b (diff)
downloadslirp-bdcd7db57a8d3dbbb6c59cff00aa922d71cd7728.zip
slirp-bdcd7db57a8d3dbbb6c59cff00aa922d71cd7728.tar.gz
slirp-bdcd7db57a8d3dbbb6c59cff00aa922d71cd7728.tar.bz2
Merge branch 'master' into hostfwd-unix
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index a92cfd3..a170676 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -43,11 +43,12 @@ struct socket *solookup(struct socket **last, struct socket *head,
* It is the responsibility of the caller to
* insque() it into the correct linked-list
*/
-struct socket *socreate(Slirp *slirp)
+struct socket *socreate(Slirp *slirp, int type)
{
struct socket *so = g_new(struct socket, 1);
memset(so, 0, sizeof(struct socket));
+ so->so_type = type;
so->so_state = SS_NOFDREF;
so->s = -1;
so->s_aux = -1;
@@ -814,7 +815,7 @@ struct socket *tcpx_listen(Slirp *slirp,
*/
g_assert(!((flags & SS_HOSTFWD) && (flags & SS_FACCEPTONCE)));
- so = socreate(slirp);
+ so = socreate(slirp, IPPROTO_TCP);
/* Don't tcp_attach... we don't need so_snd nor so_rcv */
so->so_tcpcb = tcp_newtcpcb(so);