- dhcpv4_put(&reply, &cookie, DHCPV4_OPT_DOMAIN,
- strlen(_res.dnsrch[0]), _res.dnsrch[0]);
+ uint8_t search_buf[256];
+ int len = dn_comp(_res.dnsrch[0], search_buf,
+ sizeof(search_buf), NULL, NULL);
+ if (len > 0)
+ dhcpv4_put(&reply, &cookie, DHCPV4_OPT_SEARCH_DOMAIN,
+ len, search_buf);