WIFI-900: add global property for toggling mutation of clientCn

if OVSDB_PREVENT_CLIENTCN_ALTERATION
  use clientCn from AP as is.
else
  if clientCn ends with serialNumber, use as is
  else append serialNumber
This commit is contained in:
Mike Hansen
2020-10-05 16:19:53 -04:00
parent 4f65878ce5
commit 8f30d21f69

View File

@@ -103,14 +103,20 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
// successfully connected - register it in our // successfully connected - register it in our
// connectedClients table // connectedClients table
// In Plume's environment clientCn is not unique that's why String key = null;
// we are augmenting it // can clientCn be altered
// with the serialNumber and using it as a key (equivalent if (preventClientCnAlteration) {
// of KDC unique qrCode) key = clientCn;
String key = clientCn; } else {
if (!preventClientCnAlteration) { // does clientCn already end with the AP serial number, if so, use
// this
if (clientCn.endsWith("_" + connectNodeInfo.serialNumber)) {
key = clientCn;
} else {
// append the serial number
key = clientCn + "_" + connectNodeInfo.serialNumber; key = clientCn + "_" + connectNodeInfo.serialNumber;
} }
}
ovsdbSessionMapInterface.newSession(key, ovsdbClient); ovsdbSessionMapInterface.newSession(key, ovsdbClient);
extIntegrationInterface.apConnected(key, connectNodeInfo); extIntegrationInterface.apConnected(key, connectNodeInfo);
@@ -191,10 +197,22 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
LOG.debug("Starting Client connect"); LOG.debug("Starting Client connect");
connectNodeInfo = ovsdbDao.updateConnectNodeInfoOnConnect(ovsdbClient, clientCn, connectNodeInfo); connectNodeInfo = ovsdbDao.updateConnectNodeInfoOnConnect(ovsdbClient, clientCn, connectNodeInfo);
String apId = clientCn; // successfully connected - register it in our
if (!preventClientCnAlteration) { // connectedClients table
String apId = null;
// can clientCn be altered
if (preventClientCnAlteration) {
apId = clientCn;
} else {
// does clientCn already end with the AP serial number, if so, use
// this
if (clientCn.endsWith("_" + connectNodeInfo.serialNumber)) {
apId = clientCn;
} else {
// append the serial number
apId = clientCn + "_" + connectNodeInfo.serialNumber; apId = clientCn + "_" + connectNodeInfo.serialNumber;
} }
}
LOG.debug("Client connect for AP {}", apId); LOG.debug("Client connect for AP {}", apId);
@@ -274,20 +292,6 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig); ovsdbDao.configureStatsFromProfile(ovsdbClient, opensyncAPConfig);
// Check if device stats is configured in Wifi_Stats_Config table,
// provision it
// if needed
// if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) !=
// collectionIntervalSecDeviceStats) {
// ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient,
// collectionIntervalSecDeviceStats);
// }
//
// if (((ApNetworkConfiguration)
// opensyncAPConfig.getApProfile().getDetails()).getSyntheticClientEnabled())
// {
// ovsdbDao.enableNetworkProbeForSyntheticClient(ovsdbClient);
// }
LOG.debug("Finished processConfigChanged for {}", apId); LOG.debug("Finished processConfigChanged for {}", apId);
} }