Hi Agnieszka,
I think using the first DNS server if there are multiple returned is a
good idea (until we get full support for setting multiple DNS servers
from DHCP).
However, there is a bug in your patch - in case opt_len is 0, you might
overflow the buffer. A correct check would probably be
if ((opt_len < 4) || (opt_len % 4 != 0))
return EINVAL;
Regards,
Martin Sucha
P.S. I'd commit this right now if I had the environment set up, but I
need to do some maintenance on my machines first.
On Wed, 25 Jun 2014 00:05:47 +0200
Agnieszka Tabaka <[email protected]> wrote:
> Hi all,
>
> I found that if one specify more than one DNS server in DHCP server
> configuration, HelenOS cannot aquire IP address due to check for
> opt_size == 4 at opt_dns_server in dhcp.c. It seems that opt_size in
> that case can be any multiple of 4. I created a small patch which
> allows that.
>
> However, dhcp_offer_t has room only for one DNS server address, so
> for now the first one is picked up and others are discarded.
>
> Regards,
> Agnieszka
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel