From: Alan T. DeKok Date: Sun, 11 Aug 2024 19:36:33 +0000 (-0400) Subject: don't set packet->vector for non-RADIUS protocols X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04967d0d672c161be8ee8d68db32405250d9297b;p=thirdparty%2Ffreeradius-server.git don't set packet->vector for non-RADIUS protocols and most of those were wrong, too :( --- diff --git a/src/listen/cron/proto_cron_crontab.c b/src/listen/cron/proto_cron_crontab.c index 38330456036..575f50afcdf 100644 --- a/src/listen/cron/proto_cron_crontab.c +++ b/src/listen/cron/proto_cron_crontab.c @@ -447,7 +447,6 @@ static int mod_decode(void const *instance, request_t *request, UNUSED uint8_t * if (inst->code) request->packet->code = inst->code; request->packet->id = fr_rand() & 0xff; request->reply->id = request->packet->id; - memset(request->packet->vector, 0, sizeof(request->packet->vector)); request->packet->data = talloc_zero_array(request->packet, uint8_t, 1); request->packet->data_len = 1; diff --git a/src/listen/dhcpv4/proto_dhcpv4.c b/src/listen/dhcpv4/proto_dhcpv4.c index 861e1763dde..5ea016de344 100644 --- a/src/listen/dhcpv4/proto_dhcpv4.c +++ b/src/listen/dhcpv4/proto_dhcpv4.c @@ -179,7 +179,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t * */ request->packet->id = fr_nbo_to_uint32(data + 4); request->reply->id = request->packet->id; - memcpy(request->packet->vector, data + 4, sizeof(request->packet->vector)); request->packet->data = talloc_memdup(request->packet, data, data_len); request->packet->data_len = data_len; diff --git a/src/listen/load/proto_load_step.c b/src/listen/load/proto_load_step.c index c95080bd929..ccadf4e068a 100644 --- a/src/listen/load/proto_load_step.c +++ b/src/listen/load/proto_load_step.c @@ -272,7 +272,6 @@ static int mod_decode(void const *instance, request_t *request, UNUSED uint8_t * if (inst->code) request->packet->code = inst->code; request->packet->id = fr_rand() & 0xff; request->reply->id = request->packet->id; - memset(request->packet->vector, 0, sizeof(request->packet->vector)); request->packet->data = talloc_zero_array(request->packet, uint8_t, 1); request->packet->data_len = 1; diff --git a/src/listen/vmps/proto_vmps.c b/src/listen/vmps/proto_vmps.c index 63b20e42d06..93e7424fb0b 100644 --- a/src/listen/vmps/proto_vmps.c +++ b/src/listen/vmps/proto_vmps.c @@ -167,7 +167,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t * request->packet->code = data[0]; request->packet->id = data[1]; request->reply->id = data[1]; - memcpy(request->packet->vector, data + 4, sizeof(request->packet->vector)); request->packet->data = talloc_memdup(request->packet, data, data_len); request->packet->data_len = data_len;