Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: V2.4.1.0
-
Labels:
-
Account:SPC EthernetIp Core (SPCETHERNET)
Description
Using the define EIP_OBJECT_CIP_SERVICE_CNF_SIZE in a computation might lead to unexpected results.
This is due to how this define is implemented:
#define EIP_OBJECT_CIP_SERVICE_CNF_SIZE (sizeof(EIP_OBJECT_CIP_SERVICE_CNF_T)) - EIP_OBJECT_MAX_PACKET_LEN
Workaround:
As a workaround, applications must add additional parenthesis around the define when using it to ensure proper results.
Fix:
The implementation of the define shall be changed to the following:
#define EIP_OBJECT_CIP_SERVICE_CNF_SIZE (sizeof(EIP_OBJECT_CIP_SERVICE_CNF_T) - EIP_OBJECT_MAX_PACKET_LEN)