- Patch by Michael Martin (aka bugboy) <martinmnet at hotmail dot com>

- changed dhcp to write nameserver to dhcpnameserver registry key vice nameserver
 - changed iphlpapi to return dhcpnameserver if nameserver is empty
 - set NameServer to empty string in nettcpip.inf
 - see bug 2392

svn path=/trunk/; revision=35956
This commit is contained in:
Cameron Gutman 2008-09-05 01:00:32 +00:00
parent a78ab11616
commit e941fb914b
3 changed files with 15 additions and 12 deletions

View file

@ -476,15 +476,10 @@ void set_name_servers( struct client_lease *new_lease ) {
if( i != addrs-1 ) strcat( nsbuf, "," );
}
DH_DbgPrint(MID_TRACE,("Setting Nameservers: %s\n", nsbuf));
DH_DbgPrint(MID_TRACE,("Setting DhcpNameserver: %s\n", nsbuf));
/* XXX Fixme: I think this may be wrong and that we might have
* a problem somewhere else (in iphlpapi for example).
*
* Recheck the +1 below.
*/
RegSetValueEx( RegKey, "NameServer", 0, REG_SZ,
(LPBYTE)nsbuf, strlen(nsbuf) + 1 );
RegSetValueEx( RegKey, "DhcpNameServer", 0, REG_SZ,
(LPBYTE)nsbuf, strlen(nsbuf) + 1);
free( nsbuf );
}
@ -2097,4 +2092,4 @@ fork_privchld(int fd, int fd2)
dispatch_imsg(fd);
}
}
#endif
#endif

View file

@ -224,6 +224,14 @@ PIPHLP_RES_INFO getResInfo() {
}
Str = QueryRegistryValueString( hKey, L"NameServer" );
/* If NameServer is empty */
if (*Str == L'\0')
{
/* Then use DhcpNameServer */
Str = QueryRegistryValueString( hKey, L"DhcpNameServer" );
}
ExtraServer = Str ? 1 : 0;
ServerCount += ExtraServer;
@ -283,4 +291,4 @@ PIPHLP_RES_INFO getResInfo() {
VOID disposeResInfo( PIPHLP_RES_INFO InfoPtr ) {
RtlFreeHeap( GetProcessHeap(), 0, InfoPtr );
}
}

View file

@ -55,7 +55,7 @@ AddReg = tcpip_AddReg
HKR,"Parameters","DataBasePath",0x00010000,"DataBasePath"
HKR,"Parameters","Domain",0x00010000,""
HKR,"Parameters","Hostname",0x00010000,"ROSHost"
HKR,"Parameters","NameServer",0x00010000,"0.0.0.0"
HKR,"Parameters","NameServer",0x00010000,""
HKR,"Parameters","ForwardBroadcasts",0x00010001,0x00000000
HKR,"Parameters","IPEnableRouter",0x00010001,0x00000000
HKR,"Parameters","SearchList",0x00010000,""
@ -65,4 +65,4 @@ HKR,"Parameters","EnableSecurityFilters",0x00010001,0x00000000
;-------------------------------- STRINGS -------------------------------
[Strings]
ReactOS = "ReactOS Team"
ReactOS = "ReactOS Team"