2014-12-16 18:11 GMT+03:00 nestling <[email protected]>:
>
> Hello again,
>
> 2014-12-16 17:35 GMT+03:00 nestling <[email protected]>:
>>
>>
>>
>> 2014-12-16 14:51 GMT+03:00 Dr. Torge Szczepanek <[email protected]
>> >:
>>>
>>> Hello!
>>>
>>
>> Hello
>>
>>
>>>
>>> Can you please be more verbosive? Which Radius Attribute are you
>>> referring to? Do you have a example config of your Radius Server, where you
>>> set the attribute. Can you please provide the resulting route string with
>>> and without your patch including logfiles?
>>>
>>> Greetings Torge
>>>
>>
>> I wrote about Framed-Route field. In my case it is taken from SQL and
>> look like this:
>> Framed-Route = 10.128.0.0/24
>>
>> I reread https://tools.ietf.org/html/rfc2865#section-5.22 and realized
> that I was not quite right.
> I desired behavior should be at
> Framed-Route = '10.128.0.0/24 0.0.0.0'
>
> It does not work with the patch or without.
>
I fixed my patch. It now corresponds to the RFC, and also allows specify
the route without gateway.
Index: openvpn-auth-radius-2.1/UserAcct.cpp
===================================================================
--- openvpn-auth-radius-2.1.orig/UserAcct.cpp 2010-04-02 10:18:34.000000000 +0400
+++ openvpn-auth-radius-2.1/UserAcct.cpp 2014-12-16 21:59:54.467778532 +0300
@@ -699,7 +699,11 @@
strncat(routestring, "/" ,1);
strncat(routestring, framednetmask_cidr, 2);
strncat(routestring, " gw ", 4);
- strncat(routestring, framedgw, 16);
+ if (framedgw[0] != '\0' && strncmp(framedgw, "0.0.0.0", 8) != 0)
+ strncat(routestring, framedgw, 16);
+ else
+ strncat(routestring, this->getFramedIp().c_str(), this->getFramedIp().size());
+
if (framedmetric[0]!='\0')
{
strncat(routestring, " metric ", 8);
@@ -853,7 +857,11 @@
strncat(routestring, "/" ,1);
strncat(routestring, framednetmask_cidr, 2);
strncat(routestring, " gw ", 4);
- strncat(routestring, framedgw, 16);
+ if (framedgw[0] != '\0' && strncmp(framedgw, "0.0.0.0", 8) != 0)
+ strncat(routestring, framedgw, 16);
+ else
+ strncat(routestring, this->getFramedIp().c_str(), this->getFramedIp().size());
+
if (framedmetric[0]!='\0')
{
strncat(routestring, " metric ", 8);