From 2c328d61adce8d78c30ed1f0cb62c461348b43f9 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 24 Mar 2016 13:32:01 -0700 Subject: [PATCH] Do not auto-assign IP addresses on bridges. IPs can still be assigned manually. --- controller/SqliteNetworkController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index 99fdf43cd..8f33c1dcc 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);