Create RADIUS_MAX_MSG_LEN param in the shared radius.h

The RADIUS client currently uses a hardcoded value of 3000 for the
maximum length of a RADIUS message, and the RADIUS server currently
defines a constant value for the maximum length of the RADIUS message
within its source. The client and the server should use the same
maximum length value, so this change creates a shared parameter
RADIUS_MAX_MSG_LEN within the header file radius.h and modifies
both the client and the server to use that parameter instead of
a locally set value.

Signed-off-by: Anusha Datar <anusha@meter.com>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Reviewed-by: Julian Squires <julian@cipht.net>
This commit is contained in:
Anusha Datar 2021-02-17 17:32:56 -05:00 committed by Jouni Malinen
parent 3811645e99
commit 7df089b567
3 changed files with 3 additions and 6 deletions

View file

@ -225,6 +225,8 @@ struct radius_msg;
/* Default size to be allocated for attribute array */
#define RADIUS_DEFAULT_ATTR_COUNT 16
/* Maximum message length for incoming RADIUS messages */
#define RADIUS_MAX_MSG_LEN 3000
/* MAC address ASCII format for IEEE 802.1X use
* (draft-congdon-radius-8021x-20.txt) */

View file

@ -816,7 +816,7 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
struct hostapd_radius_servers *conf = radius->conf;
RadiusType msg_type = (RadiusType) sock_ctx;
int len, roundtrip;
unsigned char buf[3000];
unsigned char buf[RADIUS_MAX_MSG_LEN + 1];
struct radius_msg *msg;
struct radius_hdr *hdr;
struct radius_rx_handler *handlers;

View file

@ -35,11 +35,6 @@
*/
#define RADIUS_MAX_SESSION 1000
/**
* RADIUS_MAX_MSG_LEN - Maximum message length for incoming RADIUS messages
*/
#define RADIUS_MAX_MSG_LEN 3000
static const struct eapol_callbacks radius_server_eapol_cb;
struct radius_client;