diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-03-24 13:32:01 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-03-24 13:32:01 -0700 |
commit | 2c328d61adce8d78c30ed1f0cb62c461348b43f9 (patch) | |
tree | 0851ce71db7adf7095f11f0428c31dac3c9f6188 | |
parent | 76f9b4c582677b7f739b8a7e220c8c907d22155b (diff) | |
download | infinitytier-2c328d61adce8d78c30ed1f0cb62c461348b43f9.tar.gz infinitytier-2c328d61adce8d78c30ed1f0cb62c461348b43f9.zip |
Do not auto-assign IP addresses on bridges. IPs can still be assigned manually.
-rw-r--r-- | controller/SqliteNetworkController.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index 99fdf43c..8f33c1dc 100644 --- a/controller/SqliteNetworkController.cpp +++ b/controller/SqliteNetworkController.cpp @@ -1861,6 +1861,7 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c netconf[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT] = ml; } + bool amActiveBridge = false; { std::string activeBridges; sqlite3_reset(_sGetActiveBridges); @@ -1871,6 +1872,8 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c if (activeBridges.length()) activeBridges.push_back(','); activeBridges.append(ab); + if (!strcmp(member.nodeId,ab)) + amActiveBridge = true; } if (activeBridges.length() > 1024) // sanity check -- you can't have too many active bridges at the moment break; @@ -1992,7 +1995,7 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c } } - if (!haveStaticIpAssignment) { + if ((!haveStaticIpAssignment)&&(!amActiveBridge)) { // Attempt to auto-assign an IPv4 address from an available routed pool sqlite3_reset(_sGetIpAssignmentPools); sqlite3_bind_text(_sGetIpAssignmentPools,1,network.id,16,SQLITE_STATIC); |