aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_pwd.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-05 17:08:51 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-07 08:45:11 (GMT)
commit16a19ddae8aa696e7c3e5ac055958a469de9380f (patch)
treea0eeff2879cf98dd55841aada44a74ed7c505ae7 /src/eap_peer/eap_pwd.c
parent60bf585ccecf7c5643ca5b7164627305b892bfc5 (diff)
downloadhostap-16a19ddae8aa696e7c3e5ac055958a469de9380f.zip
hostap-16a19ddae8aa696e7c3e5ac055958a469de9380f.tar.gz
hostap-16a19ddae8aa696e7c3e5ac055958a469de9380f.tar.bz2
EAP-pwd peer: Allow fragmentation limit to be configured
The standard fragment_size network parameter can now be used to configure EAP-pwd fragmentation limit instead of always using the hardcoded value of 1020. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer/eap_pwd.c')
-rw-r--r--src/eap_peer/eap_pwd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
index 267d0a5..fef4783 100644
--- a/src/eap_peer/eap_pwd.c
+++ b/src/eap_peer/eap_pwd.c
@@ -81,6 +81,7 @@ static void * eap_pwd_init(struct eap_sm *sm)
struct eap_pwd_data *data;
const u8 *identity, *password;
size_t identity_len, password_len;
+ int fragment_size;
password = eap_get_config_password(sm, &password_len);
if (password == NULL) {
@@ -127,7 +128,11 @@ static void * eap_pwd_init(struct eap_sm *sm)
data->out_frag_pos = data->in_frag_pos = 0;
data->inbuf = data->outbuf = NULL;
- data->mtu = 1020; /* default from RFC 5931, make it configurable! */
+ fragment_size = eap_get_config_fragment_size(sm);
+ if (fragment_size <= 0)
+ data->mtu = 1020; /* default from RFC 5931 */
+ else
+ data->mtu = fragment_size;
data->state = PWD_ID_Req;