mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Specify the interface index so the route won't get added to interface 0 (loopback)
- Warn if something tries to add a route to the loopback adapter - Fixes routing issues some people were having svn path=/trunk/; revision=43350
This commit is contained in:
parent
3ff3c916b3
commit
85a6f2a081
3 changed files with 8 additions and 0 deletions
|
@ -182,6 +182,7 @@ BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
|
||||||
Adapter->RouterMib.dwForwardDest = 0;
|
Adapter->RouterMib.dwForwardDest = 0;
|
||||||
Adapter->RouterMib.dwForwardMask = 0;
|
Adapter->RouterMib.dwForwardMask = 0;
|
||||||
Adapter->RouterMib.dwForwardMetric1 = 1;
|
Adapter->RouterMib.dwForwardMetric1 = 1;
|
||||||
|
Adapter->RouterMib.dwForwardIfIndex = Adapter->IfMib.dwIndex;
|
||||||
Adapter->RouterMib.dwForwardNextHop = inet_addr(DefaultGateway);
|
Adapter->RouterMib.dwForwardNextHop = inet_addr(DefaultGateway);
|
||||||
Error = CreateIpForwardEntry( &Adapter->RouterMib );
|
Error = CreateIpForwardEntry( &Adapter->RouterMib );
|
||||||
if( Error )
|
if( Error )
|
||||||
|
|
|
@ -519,6 +519,7 @@ void setup_adapter( PDHCP_ADAPTER Adapter, struct client_lease *new_lease ) {
|
||||||
Adapter->RouterMib.dwForwardDest = 0; /* Default route */
|
Adapter->RouterMib.dwForwardDest = 0; /* Default route */
|
||||||
Adapter->RouterMib.dwForwardMask = 0;
|
Adapter->RouterMib.dwForwardMask = 0;
|
||||||
Adapter->RouterMib.dwForwardMetric1 = 1;
|
Adapter->RouterMib.dwForwardMetric1 = 1;
|
||||||
|
Adapter->RouterMib.dwForwardIfIndex = Adapter->IfMib.dwIndex;
|
||||||
|
|
||||||
if( Adapter->RouterMib.dwForwardNextHop ) {
|
if( Adapter->RouterMib.dwForwardNextHop ) {
|
||||||
/* If we set a default route before, delete it before continuing */
|
/* If we set a default route before, delete it before continuing */
|
||||||
|
|
|
@ -181,6 +181,12 @@ TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PIPROUTE_ENTRY Route)
|
||||||
AddrInitIPv4( &Netmask, Route->Mask );
|
AddrInitIPv4( &Netmask, Route->Mask );
|
||||||
AddrInitIPv4( &Router, Route->Gw );
|
AddrInitIPv4( &Router, Route->Gw );
|
||||||
|
|
||||||
|
if (IF == Loopback)
|
||||||
|
{
|
||||||
|
DbgPrint("Failing attempt to add route to loopback adapter\n");
|
||||||
|
return TDI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
if( Route->Type == IP_ROUTE_TYPE_ADD ) { /* Add the route */
|
if( Route->Type == IP_ROUTE_TYPE_ADD ) { /* Add the route */
|
||||||
TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
|
TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
|
||||||
if (!RouterCreateRoute( &Address, &Netmask, &Router,
|
if (!RouterCreateRoute( &Address, &Netmask, &Router,
|
||||||
|
|
Loading…
Reference in a new issue