Bug 57019 - Initialising DNS via DHCP
Initialising DNS via DHCP
Product: eCos
Classification: Retired
Component: Patches and contributions (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: ecc-bugs-int
Depends On:
  Show dependency treegraph
Reported: 2001-12-03 08:16 EST by Andrew Lunn
Modified: 2007-04-18 12:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-06 08:31:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Context diff patch. (13.98 KB, patch)
2001-12-03 08:18 EST, Andrew Lunn
no flags Details | Diff

  None (edit)
Description Andrew Lunn 2001-12-03 08:16:39 EST
Description of Contribution:

The DHCP responce may contain the address of the DNS server and the domain.
When using DHCP this contribution adds extra code to extract this
information from the reply and use it to initialise the DNS resolver. It
also contains a few minor bug fixes.

Note: It needs more testing. I've tested the basic functionality, but i
don't have control over the DHCP server. So i've not tested what happens
when the lease expires, or when the server does not give back the
information needed. I've also not tested to see if i've broken redboots use
of DNS. Also, this fix has the same buffer overrun problem as reported in
one of the other bugzilla bugs i've reported today. 

So, you probably want Hugo and Gary to have a look at it.

Version-Release number of selected component (if applicable):
Comment 1 Andrew Lunn 2001-12-03 08:18:11 EST
Created attachment 39407 [details]
Context diff patch.
Comment 2 Andrew Lunn 2001-12-03 09:34:09 EST

Remove the line

    index = cyg_thread_new_data_index();

at the end of cyg_dns_res_init() in dns.h!

Comment 3 Jonathan Larmour 2001-12-04 18:46:13 EST
I'll have a look at this unless Gary/Hugo want to?
Comment 4 Hugo Tyson 2001-12-06 08:31:08 EST
I have committed this change to the trunk; a few extra diddles were needed
to make it work OK.  Though not having a DNS server, I didn't test it *with*
server, just going through the new initialization from DHCP.

Specifically, I had to release the per-thread-data index when re-starting,
and check for many NULL name pointers and return NULL *before* the assertion
check for valid pointer, so that the init to NULL works OK.

Note You need to log in before you can comment on or make changes to this bug.