Author: cgutman
Date: Sat Oct 10 04:04:13 2009
New Revision: 43350
URL:
http://svn.reactos.org/svn/reactos?rev=43350&view=rev
Log:
- 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
Modified:
trunk/reactos/base/services/dhcp/adapter.c
trunk/reactos/base/services/dhcp/dhclient.c
trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c
Modified: trunk/reactos/base/services/dhcp/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/adapter…
==============================================================================
--- trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] Sat Oct 10 04:04:13 2009
@@ -182,6 +182,7 @@
Adapter->RouterMib.dwForwardDest = 0;
Adapter->RouterMib.dwForwardMask = 0;
Adapter->RouterMib.dwForwardMetric1 = 1;
+ Adapter->RouterMib.dwForwardIfIndex = Adapter->IfMib.dwIndex;
Adapter->RouterMib.dwForwardNextHop = inet_addr(DefaultGateway);
Error = CreateIpForwardEntry( &Adapter->RouterMib );
if( Error )
Modified: trunk/reactos/base/services/dhcp/dhclient.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/dhclien…
==============================================================================
--- trunk/reactos/base/services/dhcp/dhclient.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/dhcp/dhclient.c [iso-8859-1] Sat Oct 10 04:04:13 2009
@@ -519,6 +519,7 @@
Adapter->RouterMib.dwForwardDest = 0; /* Default route */
Adapter->RouterMib.dwForwardMask = 0;
Adapter->RouterMib.dwForwardMetric1 = 1;
+ Adapter->RouterMib.dwForwardIfIndex = Adapter->IfMib.dwIndex;
if( Adapter->RouterMib.dwForwardNextHop ) {
/* If we set a default route before, delete it before continuing */
Modified: trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/ninfo.c [iso-8859-1] Sat Oct 10 04:04:13
2009
@@ -181,6 +181,12 @@
AddrInitIPv4( &Netmask, Route->Mask );
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 */
TI_DbgPrint(DEBUG_INFO,("Adding route (%s)\n", A2S(&Address)));
if (!RouterCreateRoute( &Address, &Netmask, &Router,