diff options
author | Nicholas Ngai <nicholas@ngai.me> | 2021-11-29 15:54:20 -0800 |
---|---|---|
committer | Nicholas Ngai <nicholas@ngai.me> | 2021-11-29 15:54:20 -0800 |
commit | c5b064faee6f7b0d3edde952bd3d356a2f18362d (patch) | |
tree | f2a89c76ce705aefc3774e58bc6899d22ce4f789 /src/socket.c | |
parent | e0abc86adfa9130a8b36f3d0a4729f33d4470d93 (diff) | |
download | slirp-c5b064faee6f7b0d3edde952bd3d356a2f18362d.zip slirp-c5b064faee6f7b0d3edde952bd3d356a2f18362d.tar.gz slirp-c5b064faee6f7b0d3edde952bd3d356a2f18362d.tar.bz2 |
socket: Initialize so_type in socreate
Signed-off-by: Nicholas Ngai <nicholas@ngai.me>
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c index 2c1b789..9e1e47e 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->slirp = slirp; @@ -792,7 +793,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); |