| |
|
|
|
| PA6488 Developer's Guide - Known Bugs |
| | |
| Function include |
Must include corresponding include files when calling a function.
For example, calling sprintf() without include stdio.h will not have compiler error, but will cause unpredictable results.
|
| | |
| 32-bit boundary data in struct |
When a struct mapped into a memory buffer, UINT in the struct will be wrong if it is over the 32-bit boundary.
Found in arp.c
typedef struct _ARP_FORMAT
{
USHORT sHardwareType; /* hardware type */
USHORT sProtocolType; /* protocol type */
UCHAR cHardwareLen; /* hardware address length */
UCHAR cProtocolLen; /* protocol address length */
USHORT sOperation; /* T_ARP_FORMAT operation (see AR_XXXX list above) */
UCHAR pcSHA[HW_ALEN]; /* sender's physical hardware address */
UCHAR pcSPA[IP_ALEN]; /* sender's protocol address (IP addr.) */
UCHAR pcTHA[HW_ALEN]; /* target's physical hardware address */
UCHAR pcTPA[IP_ALEN]; /* target's protocol address (IP) */
} T_ARP_FORMAT;
if chang to
typedef struct _ARP_FORMAT
{
USHORT sHardwareType; /* hardware type */
USHORT sProtocolType; /* protocol type */
UCHAR cHardwareLen; /* hardware address length */
UCHAR cProtocolLen; /* protocol address length */
USHORT sOperation; /* T_ARP_FORMAT operation (see AR_XXXX list above) */
UCHAR pcSHA[HW_ALEN]; /* sender's physical hardware address */
UINT iSPA; /* sender's protocol address (IP addr.) */
UCHAR pcTHA[HW_ALEN]; /* target's physical hardware address */
UINT iTPA; /* target's protocol address (IP) */
} T_ARP_FORMAT;
iSPA value is wrong, while iTPA is correct.
|
|