Bug 57019 - Initialising DNS via DHCP
Summary: Initialising DNS via DHCP
Status: CLOSED CURRENTRELEASE
Alias: None
Product: eCos
Classification: Retired
Component: Patches and contributions   
(Show other bugs)
Version: 1.5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: ecc-bugs-int
QA Contact: ecc-bugs-int
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-03 13:16 UTC by Andrew Lunn
Modified: 2007-04-18 16:38 UTC (History)
2 users (show)

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: ---


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

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.


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