* 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:
@@ -161,6 +161,8 @@ find_route(net_domain *_domain, const sockaddr *address)
|
|||||||
// find last matching route
|
// find last matching route
|
||||||
|
|
||||||
RouteList::Iterator iterator = domain->routes.GetIterator();
|
RouteList::Iterator iterator = domain->routes.GetIterator();
|
||||||
|
net_route_private *candidate = NULL;
|
||||||
|
|
||||||
TRACE(("test address %s for routes...\n", AddressString(domain, address).Data()));
|
TRACE(("test address %s for routes...\n", AddressString(domain, address).Data()));
|
||||||
|
|
||||||
// TODO: alternate equal default routes
|
// TODO: alternate equal default routes
|
||||||
@@ -168,10 +170,6 @@ find_route(net_domain *_domain, const sockaddr *address)
|
|||||||
while (iterator.HasNext()) {
|
while (iterator.HasNext()) {
|
||||||
net_route_private *route = iterator.Next();
|
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) {
|
if (route->mask) {
|
||||||
sockaddr maskedAddress;
|
sockaddr maskedAddress;
|
||||||
domain->address_module->mask_address(address, route->mask,
|
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",
|
TRACE((" found route: %s, flags %lx\n",
|
||||||
AddressString(domain, route->destination).Data(), route->flags));
|
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 route;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return candidate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user