rootless-containers/slirp4netns

How to specify an IPv6 CIDR?

Opened this issue · 1 comments

I'm trying to use slirp4netns for a single-stack IPv6, rootless Kubernetes cluster using k3s and can't find a way to specify the IPv6 CIDR to use. The --cidr=CIDR option apparently only accepts IPv4 addresses and I don't see any equivalent option for IPv6.
k3s generates the following command, but it fails:

$ slirp4netns --mtu 65520 -r 3 --disable-host-loopback --cidr fd5b:e9ce:dffb:cafe::/64 --enable-ipv6 12331 tap0
WARNING: Support for IPv6 is experimental
invalid CIDR: fd5b:e9ce:dffb:cafe::/64

How shall I specify the IPv6 CIDR to use?

version info:

$ slirp4netns --version
slirp4netns version 1.2.0
commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
libslirp: 4.7.0
SLIRP_CONFIG_VERSION_MAX: 4
libseccomp: 2.5.5

Currently hard-coded

slirp4netns/slirp4netns.c

Lines 263 to 272 in ee1542e

inet_pton(AF_INET6, "fd00::", &cfg.vprefix_addr6);
cfg.vprefix_len = 64;
inet_pton(AF_INET6, "fd00::2", &cfg.vhost6);
cfg.vhostname = NULL;
cfg.tftp_server_name = NULL;
cfg.tftp_path = NULL;
cfg.bootfile = NULL;
cfg.vdhcp_start = s4nn->vdhcp_start;
cfg.vnameserver = s4nn->vnameserver;
inet_pton(AF_INET6, "fd00::3", &cfg.vnameserver6);