Get the route for the correct address family.

This commit is contained in:
Stefano Ceccherini 2013-11-18 15:22:05 +01:00
parent 60cb47a410
commit 1f177e3aec

View File

@ -87,8 +87,12 @@ Settings::ReadConfiguration()
fIP = address.Address().ToString();
fNetmask = address.Mask().ToString();
int family = AF_INET;
if (address.Address().Family() != AF_UNSPEC)
family = address.Address().Family();
BNetworkAddress gatewayAddress;
if (interface.GetDefaultRoute(AF_INET, gatewayAddress) != B_OK)
if (interface.GetDefaultRoute(family, gatewayAddress) != B_OK)
return;
fGateway = gatewayAddress.ToString();