Now only removes a default route for a domain in case a new one is specified;

this fixes bug #1423, the loop interface removed the default route for the
other interface (didn't happen previously, as routes were bound to devices).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22723 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-10-25 15:15:25 +00:00
parent 9004a56437
commit ce78b3653a
1 changed files with 5 additions and 3 deletions

View File

@ -586,9 +586,6 @@ NetServer::_ConfigureInterface(int socket, BMessage& interface, bool fromMessage
route.flags = RTF_STATIC | RTF_DEFAULT;
request.ifr_route = route;
ioctl(socket, SIOCDELRT, &request, sizeof(request));
// Try to remove a previous default route, doesn't matter
// if it fails.
if (autoConfig) {
// add a default route to make the interface accessible, even without an address
@ -602,6 +599,11 @@ NetServer::_ConfigureInterface(int socket, BMessage& interface, bool fromMessage
} else if (addressMessage.FindString("gateway", &string) == B_OK
&& parse_address(familyIndex, string, gateway)) {
// add gateway route, if we're asked for it
ioctl(socket, SIOCDELRT, &request, sizeof(request));
// Try to remove a previous default route, doesn't matter
// if it fails.
route.flags = RTF_STATIC | RTF_DEFAULT | RTF_GATEWAY;
route.gateway = &gateway;