IED server: fixed problem with CONFIG_IEC61850_RCB_ALLOW_ONLY_PRECONFIGURED_CLIENT configuration option enabled

pull/291/head
Michael Zillgith 5 years ago
parent bf27774a86
commit 474a482766

@ -1666,6 +1666,10 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme
rc->reserved = true;
rc->clientConnection = connection;
}
else {
if (DEBUG_IED_SERVER)
printf("IED_SERVER: client IP not matching with pre-assigned owner\n");
}
#else
rc->reserved = true;
rc->clientConnection = connection;
@ -1701,6 +1705,18 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme
goto exit_function;
}
#if (CONFIG_IEC61850_RCB_ALLOW_ONLY_PRECONFIGURED_CLIENT == 1)
if (isIpAddressMatchingWithOwner(rc, MmsServerConnection_getClientAddress(connection)) == false) {
retVal = DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED;
if (DEBUG_IED_SERVER)
printf("IED_SERVER: client IP not matching with pre-assigned owner --> write access denied!\n");
goto exit_function;
}
#endif
if (strcmp(elementName, "RptEna") == 0) {
if (value->value.boolean == true) {

Loading…
Cancel
Save