From f1ffce558dfad6d144b5ab886924c5493a76a2c3 Mon Sep 17 00:00:00 2001 From: Henrik Holst <6200749+hholst80@users.noreply.github.com> Date: Mon, 1 Jan 2024 22:52:39 +0100 Subject: [PATCH] vlib: net.tcp_listener support only ip and ip6 --- vlib/net/tcp.c.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlib/net/tcp.c.v b/vlib/net/tcp.c.v index 9c449163222b57..8943fc8a75e484 100644 --- a/vlib/net/tcp.c.v +++ b/vlib/net/tcp.c.v @@ -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 {}