* When there was no link, the wrong route was chosen as a candidate when trying
to get a local connection (the first candidate must be used, not the last). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29208 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
|
* Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -164,7 +164,8 @@ find_route(net_domain *_domain, const sockaddr *address)
|
|||||||
RouteList::Iterator iterator = domain->routes.GetIterator();
|
RouteList::Iterator iterator = domain->routes.GetIterator();
|
||||||
net_route_private *candidate = NULL;
|
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
|
||||||
|
|
||||||
@@ -182,15 +183,19 @@ find_route(net_domain *_domain, const sockaddr *address)
|
|||||||
route->destination))
|
route->destination))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TRACE((" found route: %s, flags %lx\n",
|
|
||||||
AddressString(domain, route->destination).Data(), route->flags));
|
|
||||||
|
|
||||||
// neglect routes that point to devices that have no link
|
// neglect routes that point to devices that have no link
|
||||||
if ((route->interface->device->flags & IFF_LINK) == 0) {
|
if ((route->interface->device->flags & IFF_LINK) == 0) {
|
||||||
candidate = route;
|
if (candidate == NULL) {
|
||||||
|
TRACE((" found candidate: %s, flags %lx\n", AddressString(
|
||||||
|
domain, route->destination).Data(), route->flags));
|
||||||
|
candidate = route;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE((" found route: %s, flags %lx\n",
|
||||||
|
AddressString(domain, route->destination).Data(), route->flags));
|
||||||
|
|
||||||
return route;
|
return route;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user