]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
define MAX_RADIUS_ATTRIBUTE_SIZE
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 9 Mar 2012 07:48:46 +0000 (08:48 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 13 Mar 2012 15:27:17 +0000 (16:27 +0100)
src/libcharon/plugins/eap_radius/eap_radius.c
src/libradius/radius_message.h

index 051d46ecf1acb85c154622c54a0d47dcbecb2361..556baa26423c626b1f20e17bab4346e76ea361f8 100644 (file)
@@ -327,11 +327,12 @@ METHOD(eap_method_t, process, status_t,
        data = in->get_data(in);
        DBG3(DBG_IKE, "%N payload %B", eap_type_names, this->type, &data);
 
-       /* fragment data suitable for RADIUS (not more than 253 bytes) */
-       while (data.len > 253)
+       /* fragment data suitable for RADIUS */
+       while (data.len > MAX_RADIUS_ATTRIBUTE_SIZE)
        {
-               request->add(request, RAT_EAP_MESSAGE, chunk_create(data.ptr, 253));
-               data = chunk_skip(data, 253);
+               request->add(request, RAT_EAP_MESSAGE,
+                                        chunk_create(data.ptr,MAX_RADIUS_ATTRIBUTE_SIZE));
+               data = chunk_skip(data, MAX_RADIUS_ATTRIBUTE_SIZE);
        }
        request->add(request, RAT_EAP_MESSAGE, data);
 
index a03af3362f8f7b1b75a1a0d23d0a7b3e96c009c2..55cb484ffeb98d551631e26166b958bac47a3a5c 100644 (file)
@@ -28,6 +28,8 @@
 
 #include <library.h>
 
+#define MAX_RADIUS_ATTRIBUTE_SIZE      253
+
 typedef struct radius_message_t radius_message_t;
 typedef enum radius_message_code_t radius_message_code_t;
 typedef enum radius_attribute_type_t radius_attribute_type_t;