sqlippool in 3.0

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri Oct 11 18:57:41 CEST 2013


On 11 Oct 2013, at 16:12, Phil Mayers <p.mayers at IMPERIAL.AC.UK> wrote:

> On 11/10/13 11:17, Phil Mayers wrote:
>> I think this is broken; specifically, "ip_allocation" is used undefined
>> in the successful case.
> 
> No, that's not it; the problem is that vp_length is unset i.e. 0.
> 
> For some reason:
> 
> fr_strerror_printf("WARNING: Skipping zero-length attribute
> 
> ...in src/lib/radius.c isn't warning about this.
> 
> Fix is simple:
> 
> diff --git a/src/modules/rlm_sqlippool/rlm_sqlippool.c b/src/modules/rlm_sqlippool/rlm_sqlippool.c
> index 1db4478..bb0c98e 100644
> --- a/src/modules/rlm_sqlippool/rlm_sqlippool.c
> +++ b/src/modules/rlm_sqlippool/rlm_sqlippool.c
> @@ -607,6 +607,7 @@ static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request)
>        vp = radius_paircreate(request, &request->reply->vps,
>                               PW_FRAMED_IP_ADDRESS, 0);
>        vp->vp_ipaddr = ip_allocation;
> +       vp->length = 4;
> 
>        DO(allocate_commit);

OK, merged that. 

I wonder whether it might be an idea to pre-initialize the length in paircreate for fixed length attributes?

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team



More information about the Freeradius-Devel mailing list