Multiple problems in DHCP client
sebastien at milkymist.org
Fri May 6 13:02:16 UTC 2011
I have several concerns reading the DHCP client code:
1) When the /etc/resolv.conf file is built, the code reads the
rtems_bsdnet_ntpserver table instead of the rtems_bsdnet_nameserver
table (line 1092 of rtems_dhcp.c). Was this code tested?
2) Why do we need to build an /etc/resolv.conf at all, since the
resolver already reads the rtems_bsdnet_nameserver table directly in
3) The variable rtems_bsdnet_nameserver_count is not set to 0 at the
beginning of the DHCP request, which means that when DHCP is restarted,
the DNS entries keep piling up until the table is full (3 entries), at
which point the new DNS will not be taken into account at all.
4) For the new name servers to be taken into account, it seems that
res_init() has to be called. This function is run on the first call to
another name resolver function, and sets up the resolver internal state
according to the rtems_bsdnet_nameserver table and /etc/resolv.conf (if
any). I think it should be called again to take into account
modifications to the DNS settings, but it is not clear to me how and
when it should be done, especially wrt locking (what happens if
res_init() is preempted in the middle of a modification of the resolver
state by another task that happens to do a DNS resolution?).
More information about the users