aboutsummaryrefslogtreecommitdiff
path: root/net/slirp.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-11 10:16:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-12 12:29:44 +0200
commitbce63ded2066a21cc1f5922d0bf667123123d6f6 (patch)
treef1a64e8d8c84cc036468c3f0262bffe00eb4ccfa /net/slirp.c
parentad2e5b87d7d070cb4c0a3ba1c20a4ec5e6429301 (diff)
downloadqemu-bce63ded2066a21cc1f5922d0bf667123123d6f6.zip
qemu-bce63ded2066a21cc1f5922d0bf667123123d6f6.tar.gz
qemu-bce63ded2066a21cc1f5922d0bf667123123d6f6.tar.bz2
net: slirp: switch to slirp_new
Replace slirp_init with slirp_new, so that a more recent cfg.version can be specified. The function appeared in version 4.1.0. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'net/slirp.c')
-rw-r--r--net/slirp.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/net/slirp.c b/net/slirp.c
index f1e25d7..b7464be 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -389,6 +389,7 @@ static int net_slirp_init(NetClientState *peer, const char *model,
#if defined(CONFIG_SMBD_COMMAND)
struct in_addr smbsrv = { .s_addr = 0 };
#endif
+ SlirpConfig cfg = { 0 };
NetClientState *nc;
SlirpState *s;
char buf[20];
@@ -577,12 +578,26 @@ static int net_slirp_init(NetClientState *peer, const char *model,
s = DO_UPCAST(SlirpState, nc, nc);
- s->slirp = slirp_init(restricted, ipv4, net, mask, host,
- ipv6, ip6_prefix, vprefix6_len, ip6_host,
- vhostname, tftp_server_name,
- tftp_export, bootfile, dhcp,
- dns, ip6_dns, dnssearch, vdomainname,
- &slirp_cb, s);
+ cfg.version = 1;
+ cfg.restricted = restricted;
+ cfg.in_enabled = ipv4;
+ cfg.vnetwork = net;
+ cfg.vnetmask = mask;
+ cfg.vhost = host;
+ cfg.in6_enabled = ipv6;
+ cfg.vprefix_addr6 = ip6_prefix;
+ cfg.vprefix_len = vprefix6_len;
+ cfg.vhost6 = ip6_host;
+ cfg.vhostname = vhostname;
+ cfg.tftp_server_name = tftp_server_name;
+ cfg.tftp_path = tftp_export;
+ cfg.bootfile = bootfile;
+ cfg.vdhcp_start = dhcp;
+ cfg.vnameserver = dns;
+ cfg.vnameserver6 = ip6_dns;
+ cfg.vdnssearch = dnssearch;
+ cfg.vdomainname = vdomainname;
+ s->slirp = slirp_new(&cfg, &slirp_cb, s);
QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry);
/*