From 7f1092aa9659fbc4c8b6fc2e3e6dab6389e5b19d Mon Sep 17 00:00:00 2001 From: Henrik Holst <6200749+hholst80@users.noreply.github.com> Date: Mon, 1 Jan 2024 23:44:28 +0100 Subject: [PATCH] net: support only ip and ip6 in net.tcp_listener (#20336) --- 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 {}