slirp: Add domainname option to slirp's DHCP server

This patch will allow the user to include the domainname option in
replies from the built-in DHCP server.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Benjamin Drung 2018-02-27 17:06:01 +01:00 committed by Samuel Thibault
parent c181ddaa17
commit f18d137542
7 changed files with 31 additions and 7 deletions

View file

@ -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;