aboutsummaryrefslogtreecommitdiff
path: root/slirp.c
diff options
context:
space:
mode:
authorKlaus Stengel <Klaus.Stengel@asamnet.de>2012-10-27 19:53:39 +0200
committerJan Kiszka <jan.kiszka@siemens.com>2012-11-15 10:27:14 +0100
commit9d549098244cca65f0eb8485c3bf745b333cb21f (patch)
tree1e99e6f53de11b8a1237ae481be20369084f640e /slirp.c
parent76738578355e5e5be7cfa6217c33551fb7b38d3d (diff)
downloadslirp-1.3.1.zip
slirp-1.3.1.tar.gz
slirp-1.3.1.tar.bz2
slirp: Add domain-search option to slirp's DHCP serverv1.3.1v1.3.0-rc2v1.3.0-rc1v1.3.0-rc0v1.3.0
This patch will allow the user to include the domain-search option in replies from the built-in DHCP server. The domain suffixes can be specified by adding dnssearch= entries to the "-net user" parameter. [Jan: tiny style adjustments] Signed-off-by: Klaus Stengel <Klaus.Stengel@asamnet.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Diffstat (limited to 'slirp.c')
-rw-r--r--slirp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/slirp.c b/slirp.c
index fc2b75f..78e3983 100644
--- a/slirp.c
+++ b/slirp.c
@@ -202,7 +202,8 @@ Slirp *slirp_init(int restricted, struct in_addr vnetwork,
struct in_addr vnetmask, struct in_addr vhost,
const char *vhostname, const char *tftp_path,
const char *bootfile, struct in_addr vdhcp_start,
- struct in_addr vnameserver, void *opaque)
+ struct in_addr vnameserver, const char **vdnssearch,
+ void *opaque)
{
Slirp *slirp = g_malloc0(sizeof(Slirp));
@@ -232,6 +233,10 @@ Slirp *slirp_init(int restricted, struct in_addr vnetwork,
slirp->vdhcp_startaddr = vdhcp_start;
slirp->vnameserver_addr = vnameserver;
+ if (vdnssearch) {
+ translate_dnssearch(slirp, vdnssearch);
+ }
+
slirp->opaque = opaque;
register_savevm(NULL, "slirp", 0, 3, slirp_state_save, slirp_state_load,
@@ -251,6 +256,7 @@ void slirp_cleanup(Slirp *slirp)
ip_cleanup(slirp);
m_cleanup(slirp);
+ g_free(slirp->vdnssearch);
g_free(slirp->tftp_prefix);
g_free(slirp->bootp_filename);
g_free(slirp);