mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
ad2e5b87d7
commit
bce63ded20
2 changed files with 22 additions and 7 deletions
27
net/slirp.c
27
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);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue