Bug 57019

Summary: Initialising DNS via DHCP
Product: [Retired] eCos Reporter: Andrew Lunn <andrew.lunn>
Component: Patches and contributionsAssignee: ecc-bugs-int
Status: CLOSED CURRENTRELEASE QA Contact: ecc-bugs-int
Severity: medium Docs Contact:
Priority: medium    
Version: 1.5.2CC: gthomas, hmt
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-12-06 13:31:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Context diff patch. none

Description Andrew Lunn 2001-12-03 13:16:39 UTC
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):
1.5.2-final.

Comment 1 Andrew Lunn 2001-12-03 13:18:11 UTC
Created attachment 39407 [details]
Context diff patch.

Comment 2 Andrew Lunn 2001-12-03 14:34:09 UTC
Duh!

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 23:46:13 UTC
I'll have a look at this unless Gary/Hugo want to?


Comment 4 Hugo Tyson 2001-12-06 13:31:08 UTC
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.