Should MAX_STRING_LEN be 253?

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri Aug 19 16:18:29 CEST 2011


On 19 Aug 2011, at 16:13, Makarand Pradhan wrote:

> Appreciate your prompt response Alan.
> 
> I do understand that I have to split the EAP message every 253 bytes. I can define it as a constant in my code, but I would prefer to use a constant defined by the freeradius package. MAX_STRING_LEN appeared to be the obvious choice.
> 

Define your own constant, the maximum RADIUS attribute value length will not be changing any time soon, or at least not in ways you'll have to worry about.

> I'm using (MAX_STRING_LEN - 1), but if MAX_STRING_LEN is used for some other internal reasons to FreeRadius, it may change in the future breaking my code. That's my only worry.

It may go away entirely at some point and break your code.

-Arran

> On 18/08/11 07:18 PM, Alan DeKok wrote:
>> Makarand Pradhan wrote:
>>   
>>> As the constant MAX_STRING_LEN is being used in our code to split a big
>>> EAP message into multiple segments, we tend to loose one byte in every
>>> segment causing authentication failure (malformed packet received).
>>>     
>>   Your code is wrong... it should be splitting EAP messages every 253
>> octets.
>> 
>>   
>>> Question:
>>> Based on the above analysis it was felt that the constant should be 253.
>>> Should the constant be changed to 253 or is there any other reason for
>>> keeping it at 254?
>>>     
>>   The constant is 254 for reasons internal to FreeRADIUS.
>> 
>>   Alan DeKok.
>> -
>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
>> 
>>   
> 
> 
> -- 
> ___________________________________________________________________________
> NOTICE OF CONFIDENTIALITY:
> This e-mail and any attachments may contain confidential and privileged information.  If you are
> not the intended recipient, please notify the sender immediately by return e-mail and delete this
> e-mail and any copies.  Any dissemination or use of this information by a person other than the
> intended recipient is unauthorized and may be illegal.
> _____________________________________________________________________
> 
> 
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
> 

Arran Cudbard-Bell
a.cudbardb at freeradius.org

RADIUS - Half the complexity of Diameter





More information about the Freeradius-Devel mailing list