summaryrefslogtreecommitdiff
path: root/qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch
diff options
context:
space:
mode:
Diffstat (limited to 'qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch')
-rw-r--r--qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch179
1 files changed, 0 insertions, 179 deletions
diff --git a/qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch b/qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch
deleted file mode 100644
index c748356..0000000
--- a/qemu_patches/0001-slirp-add-slirp_initx-SlirpConfig-SlirpCb-void.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 084c852ecd296049c3167b07c6b2e3a6845fe868 Mon Sep 17 00:00:00 2001
-From: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
-Date: Wed, 6 Mar 2019 16:07:23 +0900
-Subject: [PATCH 1/3] slirp: add slirp_initx(SlirpConfig *, SlirpCb *, void *)
-
-Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
----
- slirp/src/libslirp.h | 24 ++++++++++-
- slirp/src/slirp.c | 97 ++++++++++++++++++++++++++++----------------
- 2 files changed, 86 insertions(+), 35 deletions(-)
-
-diff --git a/slirp/src/libslirp.h b/slirp/src/libslirp.h
-index 3b28764bec..bd141964ff 100644
---- a/slirp/src/libslirp.h
-+++ b/slirp/src/libslirp.h
-@@ -64,7 +64,29 @@ typedef struct SlirpCb {
- void (*notify)(void *opaque);
- } SlirpCb;
-
--
-+typedef struct SlirpConfig{
-+ int restricted;
-+ bool in_enabled;
-+ struct in_addr vnetwork;
-+ struct in_addr vnetmask;
-+ struct in_addr vhost;
-+ bool in6_enabled;
-+ struct in6_addr vprefix_addr6;
-+ uint8_t vprefix_len;
-+ struct in6_addr vhost6;
-+ const char *vhostname;
-+ const char *tftp_server_name;
-+ const char *tftp_path;
-+ const char *bootfile;
-+ struct in_addr vdhcp_start;
-+ struct in_addr vnameserver;
-+ struct in6_addr vnameserver6;
-+ const char **vdnssearch;
-+ const char *vdomainname;
-+} SlirpConfig;
-+
-+Slirp *slirp_initx(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque);
-+/* slirp_init is deprecated in favor of slirp_initx */
- Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
- struct in_addr vnetmask, struct in_addr vhost,
- bool in6_enabled,
-diff --git a/slirp/src/slirp.c b/slirp/src/slirp.c
-index 169c85b906..ee5833e18b 100644
---- a/slirp/src/slirp.c
-+++ b/slirp/src/slirp.c
-@@ -270,30 +270,23 @@ static void slirp_init_once(void)
-
- }
-
--Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
-- struct in_addr vnetmask, struct in_addr vhost,
-- bool in6_enabled,
-- struct in6_addr vprefix_addr6, uint8_t vprefix_len,
-- struct in6_addr vhost6, const char *vhostname,
-- const char *tftp_server_name,
-- const char *tftp_path, const char *bootfile,
-- struct in_addr vdhcp_start, struct in_addr vnameserver,
-- struct in6_addr vnameserver6, const char **vdnssearch,
-- const char *vdomainname,
-- const SlirpCb *callbacks,
-- void *opaque)
-+Slirp *slirp_initx(const SlirpConfig *cfg, const SlirpCb *callbacks, void *opaque)
- {
-- Slirp *slirp = g_malloc0(sizeof(Slirp));
-+ Slirp *slirp;
-+ if (cfg == NULL) {
-+ return NULL;
-+ }
-+ slirp = g_malloc0(sizeof(Slirp));
-
- slirp_init_once();
-
- slirp->opaque = opaque;
- slirp->cb = callbacks;
- slirp->grand = g_rand_new();
-- slirp->restricted = restricted;
-+ slirp->restricted = cfg->restricted;
-
-- slirp->in_enabled = in_enabled;
-- slirp->in6_enabled = in6_enabled;
-+ slirp->in_enabled = cfg->in_enabled;
-+ slirp->in6_enabled = cfg->in6_enabled;
-
- if_init(slirp);
- ip_init(slirp);
-@@ -302,31 +295,67 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
- /* Initialise mbufs *after* setting the MTU */
- m_init(slirp);
-
-- slirp->vnetwork_addr = vnetwork;
-- slirp->vnetwork_mask = vnetmask;
-- slirp->vhost_addr = vhost;
-- slirp->vprefix_addr6 = vprefix_addr6;
-- slirp->vprefix_len = vprefix_len;
-- slirp->vhost_addr6 = vhost6;
-- if (vhostname) {
-+ slirp->vnetwork_addr = cfg->vnetwork;
-+ slirp->vnetwork_mask = cfg->vnetmask;
-+ slirp->vhost_addr = cfg->vhost;
-+ slirp->vprefix_addr6 = cfg->vprefix_addr6;
-+ slirp->vprefix_len = cfg->vprefix_len;
-+ slirp->vhost_addr6 = cfg->vhost6;
-+ if (cfg->vhostname) {
- slirp_pstrcpy(slirp->client_hostname, sizeof(slirp->client_hostname),
-- vhostname);
-+ cfg->vhostname);
- }
-- slirp->tftp_prefix = g_strdup(tftp_path);
-- slirp->bootp_filename = g_strdup(bootfile);
-- slirp->vdomainname = g_strdup(vdomainname);
-- slirp->vdhcp_startaddr = vdhcp_start;
-- slirp->vnameserver_addr = vnameserver;
-- slirp->vnameserver_addr6 = vnameserver6;
-- slirp->tftp_server_name = g_strdup(tftp_server_name);
--
-- if (vdnssearch) {
-- translate_dnssearch(slirp, vdnssearch);
-+ slirp->tftp_prefix = g_strdup(cfg->tftp_path);
-+ slirp->bootp_filename = g_strdup(cfg->bootfile);
-+ slirp->vdomainname = g_strdup(cfg->vdomainname);
-+ slirp->vdhcp_startaddr = cfg->vdhcp_start;
-+ slirp->vnameserver_addr = cfg->vnameserver;
-+ slirp->vnameserver_addr6 = cfg->vnameserver6;
-+ slirp->tftp_server_name = g_strdup(cfg->tftp_server_name);
-+
-+ if (cfg->vdnssearch) {
-+ translate_dnssearch(slirp, cfg->vdnssearch);
- }
-
- return slirp;
- }
-
-+Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
-+ struct in_addr vnetmask, struct in_addr vhost,
-+ bool in6_enabled,
-+ struct in6_addr vprefix_addr6, uint8_t vprefix_len,
-+ struct in6_addr vhost6, const char *vhostname,
-+ const char *tftp_server_name,
-+ const char *tftp_path, const char *bootfile,
-+ struct in_addr vdhcp_start, struct in_addr vnameserver,
-+ struct in6_addr vnameserver6, const char **vdnssearch,
-+ const char *vdomainname,
-+ const SlirpCb *callbacks,
-+ void *opaque)
-+{
-+ SlirpConfig cfg;
-+ memset(&cfg, 0, sizeof(cfg));
-+ cfg.restricted = restricted;
-+ cfg.in_enabled = in_enabled;
-+ cfg.vnetwork = vnetwork;
-+ cfg.vnetmask = vnetmask;
-+ cfg.vhost = vhost;
-+ cfg.in6_enabled = in6_enabled;
-+ cfg.vprefix_addr6 = vprefix_addr6;
-+ cfg.vprefix_len = vprefix_len;
-+ cfg.vhost6 = vhost6;
-+ cfg.vhostname = vhostname;
-+ cfg.tftp_server_name = tftp_server_name;
-+ cfg.tftp_path = tftp_path;
-+ cfg.bootfile = bootfile;
-+ cfg.vdhcp_start = vdhcp_start;
-+ cfg.vnameserver = vnameserver;
-+ cfg.vnameserver6 = vnameserver6;
-+ cfg.vdnssearch = vdnssearch;
-+ cfg.vdomainname = vdomainname;
-+ return slirp_initx(&cfg, callbacks, opaque);
-+}
-+
- void slirp_cleanup(Slirp *slirp)
- {
- struct gfwd_list *e, *next;
---
-2.20.1
-