* Routes that belong to an interface without a link are no longer

ignored, but other routes will be preferred if available.
* This fixes problems with networking cards that don't report their
  link status correctly (ipro100, see bug #1936), or too late 
  (nforce, ipro1000, see bug #1941). Drivers that did not report any
  status at all were not affected, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24459 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-03-19 10:42:46 +00:00
parent c2383f9c82
commit 573d0b4d6d
+9 -5
View File
@@ -161,6 +161,8 @@ find_route(net_domain *_domain, const sockaddr *address)
// find last matching route
RouteList::Iterator iterator = domain->routes.GetIterator();
net_route_private *candidate = NULL;
TRACE(("test address %s for routes...\n", AddressString(domain, address).Data()));
// TODO: alternate equal default routes
@@ -168,10 +170,6 @@ find_route(net_domain *_domain, const sockaddr *address)
while (iterator.HasNext()) {
net_route_private *route = iterator.Next();
// ignore routes that point to devices that have no link
if ((route->interface->device->flags & IFF_LINK) == 0)
continue;
if (route->mask) {
sockaddr maskedAddress;
domain->address_module->mask_address(address, route->mask,
@@ -186,10 +184,16 @@ find_route(net_domain *_domain, const sockaddr *address)
TRACE((" found route: %s, flags %lx\n",
AddressString(domain, route->destination).Data(), route->flags));
// neglect routes that point to devices that have no link
if ((route->interface->device->flags & IFF_LINK) == 0) {
candidate = route;
continue;
}
return route;
}
return NULL;
return candidate;
}