IPX: Use more the nd_uint32_t type

In 'struct ipxHdr'.
This avoid some 'undefined-behavior' warnings with clang and option
-fsanitize=undefined enabled.

print-ipx.c:79:2: runtime error: member access within misaligned address
0x61d00001ea91 for type 'const struct ipxHdr', which requires 2 byte alignment
0x61d00001ea91: note: pointer points here
 54 e0 e0  03 ff ff 00 50 00 14 00  00 00 00 ff ff ff ff ff  ff 04 55 a8 f8 79 67 00  00 00 00 00 01
              ^
SUMMARY: AddressSanitizer: undefined-behavior print-ipx.c:79:2 in
This commit is contained in:
Francois-Xavier Le Bail 2018-01-30 19:03:49 +01:00
parent aa9960a2c3
commit 470c75a397

View File

@ -50,10 +50,10 @@ struct ipxHdr {
nd_uint16_t length; /* Length, in bytes, including header */
nd_uint8_t tCtl; /* Transport Control (i.e. hop count) */
nd_uint8_t pType; /* Packet Type (i.e. level 2 protocol) */
uint16_t dstNet[2]; /* destination net */
nd_uint32_t dstNet; /* destination net */
nd_byte dstNode[6]; /* destination node */
nd_uint16_t dstSkt; /* destination socket */
uint16_t srcNet[2]; /* source net */
nd_uint32_t srcNet; /* source net */
nd_byte srcNode[6]; /* source node */
nd_uint16_t srcSkt; /* source socket */
};