]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-pwd peer: Allow fragmentation limit to be configured
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 17:08:51 +0000 (19:08 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:11 +0000 (10:45 +0200)
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>

src/eap_peer/eap_pwd.c

index 267d0a5c69768d57bc096a64ea8479a83f543339..fef478370c1117031350f7eb45792651f2e2e9f0 100644 (file)
@@ -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;