mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
get default network interface from the default route
This commit is contained in:
committed by
Mohammad Al-Turany
parent
eaa220e39e
commit
91b7a72ac5
@@ -185,9 +185,14 @@ void FairMQDevice::InitWrapper()
|
||||
|
||||
if (vi->fMethod == "bind")
|
||||
{
|
||||
// if binding address is not specified, set it up to try getting it from the configured network interface
|
||||
// if binding address is not specified, try getting it from the configured network interface
|
||||
if (vi->fAddress == "unspecified" || vi->fAddress == "")
|
||||
{
|
||||
// if the configured network interface is default, get its name from the default route
|
||||
if (fNetworkInterface == "default")
|
||||
{
|
||||
fNetworkInterface = FairMQ::tools::getDefaultRouteNetworkInterface();
|
||||
}
|
||||
vi->fAddress = "tcp://" + FairMQ::tools::getInterfaceIP(fNetworkInterface) + ":1";
|
||||
}
|
||||
// fill the uninitialized list
|
||||
|
Reference in New Issue
Block a user