This change fixes some undefined behaviors at runtime.
The errors were like:
print-ipx.c:160:12: runtime error: unsigned integer overflow:
1 - 2 cannot be represented in type 'unsigned int'
print-ipx.c:233:12: runtime error: unsigned integer overflow:
1 - 2 cannot be represented in type 'unsigned int'
int command, i;
command = GET_BE_U_2(ipx);
+ ND_LCHECK_U(length, 2);
ipx += 2;
length -= 2;
int command, i;
command = GET_BE_U_2(ipx);
+ ND_LCHECK_U(length, 2);
ipx += 2;
length -= 2;