return NULL;
}
- if ((code[1] < 1) || (code[2] == 0) || (code[2] > DHCP_MAX_MESSAGE_TYPE)) {
+ if ((code[1] < 1) || (code[2] == 0) || (code[2] >= DHCP_MAX_MESSAGE_TYPE)) {
fr_strerror_printf("Unknown value %d for message-type option", code[2]);
rad_free(&packet);
return NULL;
char src_ip_buf[256], dst_ip_buf[256];
if ((packet->code >= PW_DHCP_DISCOVER) &&
- (packet->code <= (1024 + DHCP_MAX_MESSAGE_TYPE))) {
+ (packet->code < (1024 + DHCP_MAX_MESSAGE_TYPE))) {
name = dhcp_message_types[packet->code - PW_DHCP_OFFSET];
} else {
snprintf(type_buf, sizeof(type_buf), "%d",
char dst_ip_buf[INET6_ADDRSTRLEN];
if ((packet->code >= PW_DHCP_DISCOVER) &&
- (packet->code <= (1024 + DHCP_MAX_MESSAGE_TYPE))) {
+ (packet->code < (1024 + DHCP_MAX_MESSAGE_TYPE))) {
name = dhcp_message_types[packet->code - PW_DHCP_OFFSET];
} else {
snprintf(type_buf, sizeof(type_buf), "%d",
#ifndef NDEBUG
if ((packet->code >= PW_DHCP_DISCOVER) &&
- (packet->code <= (1024 + DHCP_MAX_MESSAGE_TYPE))) {
+ (packet->code < (1024 + DHCP_MAX_MESSAGE_TYPE))) {
name = dhcp_message_types[packet->code - PW_DHCP_OFFSET];
} else {
name = "?Unknown?";
char dst_ip_buf[INET6_ADDRSTRLEN];
if ((packet->code >= PW_DHCP_DISCOVER) &&
- (packet->code <= (1024 + DHCP_MAX_MESSAGE_TYPE))) {
+ (packet->code < (1024 + DHCP_MAX_MESSAGE_TYPE))) {
name = dhcp_message_types[packet->code - PW_DHCP_OFFSET];
} else {
snprintf(type_buf, sizeof(type_buf), "%d",
char src_ip_buf[256], dst_ip_buf[256];
if ((packet->code >= PW_DHCP_DISCOVER) &&
- (packet->code <= (1024 + DHCP_MAX_MESSAGE_TYPE))) {
+ (packet->code < (1024 + DHCP_MAX_MESSAGE_TYPE))) {
name = dhcp_message_types[packet->code - PW_DHCP_OFFSET];
} else {
snprintf(type_buf, sizeof(type_buf), "%d", packet->code - PW_DHCP_OFFSET);