Skip to content

Commit

Permalink
net: support only ip and ip6 in net.tcp_listener (#20336)
Browse files Browse the repository at this point in the history
  • Loading branch information
hholst80 committed Jan 1, 2024
1 parent 54ff7a2 commit 7f1092a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/net/tcp.c.v
Expand Up @@ -301,6 +301,9 @@ pub:
}

pub fn listen_tcp(family AddrFamily, saddr string, options ListenOptions) !&TcpListener {
if family != .ip && family != .ip6 {
return error('listen_tcp only supports ip and ip6')
}
mut s := new_tcp_socket(family) or { return error('${err.msg()}; could not create new socket') }
s.set_dualstack(options.dualstack) or {}

Expand Down

0 comments on commit 7f1092a

Please sign in to comment.