On 08.02.2016 11:28, Samuel Thibault wrote: > From: Yann Bordenave <m...@meowstars.org> > > This patch adds parameters to manage some new options in the qemu -net > command. > Slirp IPv6 address, network prefix, and DNS IPv6 address can be given in > argument to the qemu command. > Defaults parameters are respectively fec0::2, fec0::, /64 and fec0::3. > > Signed-off-by: Yann Bordenave <m...@meowstars.org> > Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> > --- > net/net.c | 31 +++++++++++++++++++++++++++++++ > net/slirp.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------ > qapi-schema.json | 40 ++++++++++++++++++++++++++-------------- > qemu-options.hx | 18 ++++++++++++++++-- > slirp/libslirp.h | 8 +++++--- > slirp/slirp.c | 16 +++++++++------- > 6 files changed, 131 insertions(+), 32 deletions(-) ... > diff --git a/net/slirp.c b/net/slirp.c > index 6b51fbc..076dd27 100644 > --- a/net/slirp.c > +++ b/net/slirp.c > @@ -135,17 +135,23 @@ static NetClientInfo net_slirp_info = { > static int net_slirp_init(NetClientState *peer, const char *model, > const char *name, int restricted, > const char *vnetwork, const char *vhost, > + const char *vprefix6, int vprefix6_len, > + const char *vhost6, > const char *vhostname, const char *tftp_export, > const char *bootfile, const char *vdhcp_start, > - const char *vnameserver, const char *smb_export, > - const char *vsmbserver, const char **dnssearch) > + const char *vnameserver, const char *vnameserver6, > + const char *smb_export, const char *vsmbserver, > + const char **dnssearch) > { > /* default settings according to historic slirp */ > struct in_addr net = { .s_addr = htonl(0x0a000200) }; /* 10.0.2.0 */ > struct in_addr mask = { .s_addr = htonl(0xffffff00) }; /* 255.255.255.0 > */ > struct in_addr host = { .s_addr = htonl(0x0a000202) }; /* 10.0.2.2 */ > + struct in6_addr ip6_prefix; > + struct in6_addr ip6_host; > struct in_addr dhcp = { .s_addr = htonl(0x0a00020f) }; /* 10.0.2.15 */ > struct in_addr dns = { .s_addr = htonl(0x0a000203) }; /* 10.0.2.3 */ > + struct in6_addr ip6_dns; > #ifndef _WIN32 > struct in_addr smbsrv = { .s_addr = 0 }; > #endif > @@ -213,6 +219,27 @@ static int net_slirp_init(NetClientState *peer, const > char *model, > return -1; > } > > + if (!vprefix6) { > + vprefix6 = "fec0::";
Site-local prefixes have already been deprecated (see rfc3879) ... would it be feasible to use a ULA prefix instead (fd00::/8, see rfc4193) ? Thomas