diff options
Diffstat (limited to 'slirp')
-rw-r--r-- | slirp/bootp.c | 8 | ||||
-rw-r--r-- | slirp/libslirp.h | 2 | ||||
-rw-r--r-- | slirp/slirp.c | 4 | ||||
-rw-r--r-- | slirp/slirp.h | 1 |
4 files changed, 13 insertions, 2 deletions
diff --git a/slirp/bootp.c b/slirp/bootp.c index 5dd1a415b5..9e7b53ba94 100644 --- a/slirp/bootp.c +++ b/slirp/bootp.c @@ -298,6 +298,14 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) q += val; } + if (slirp->vdomainname) { + val = strlen(slirp->vdomainname); + *q++ = RFC1533_DOMAINNAME; + *q++ = val; + memcpy(q, slirp->vdomainname, val); + q += val; + } + if (slirp->vdnssearch) { size_t spaceleft = sizeof(rbp->bp_vend) - (q - rbp->bp_vend); val = slirp->vdnssearch_len; diff --git a/slirp/libslirp.h b/slirp/libslirp.h index 540b3e5903..740408a96e 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@ -16,7 +16,7 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork, const char *tftp_path, const char *bootfile, struct in_addr vdhcp_start, struct in_addr vnameserver, struct in6_addr vnameserver6, const char **vdnssearch, - void *opaque); + const char *vdomainname, void *opaque); void slirp_cleanup(Slirp *slirp); void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout); diff --git a/slirp/slirp.c b/slirp/slirp.c index 1cb6b07004..4f29753444 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -286,7 +286,7 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork, const char *tftp_path, const char *bootfile, struct in_addr vdhcp_start, struct in_addr vnameserver, struct in6_addr vnameserver6, const char **vdnssearch, - void *opaque) + const char *vdomainname, void *opaque) { Slirp *slirp = g_malloc0(sizeof(Slirp)); @@ -317,6 +317,7 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork, } 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; @@ -349,6 +350,7 @@ void slirp_cleanup(Slirp *slirp) g_free(slirp->vdnssearch); g_free(slirp->tftp_prefix); g_free(slirp->bootp_filename); + g_free(slirp->vdomainname); g_free(slirp); } diff --git a/slirp/slirp.h b/slirp/slirp.h index 06febfc78b..10b410898a 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -193,6 +193,7 @@ struct Slirp { char *bootp_filename; size_t vdnssearch_len; uint8_t *vdnssearch; + char *vdomainname; /* tcp states */ struct socket tcb; |