Hello!
Radius pairs has two similar types: integer and ipaddr. generate_avps In modules/misc_radius/functions.c, function generate_avps() we see that attribute checked for PW_TYPE_INTEGER (integer) type. That incorrect: when rad attribute has PW_TYPE_IPADDR (for example Framed-IP-Addr) then we raise error, but we must processing ipaddr same as integer.
As result misc_radius cant sent queries with PW_TYPE_IPADDR at all: error "attribute ## not integer" raised.
Need correct this same way:
@@ -142,7 +196,8 @@ static void generate_avps(struct attr *attrs, VALUE_PAIR* received) do { \ if ((_len) != 0) { \ if ((_len) == -1) { \ - if (_attrs[_attr].t != PW_TYPE_INTEGER) { \ + if (_attrs[_attr].t != PW_TYPE_INTEGER) \ + if (_attrs[_attr].t != PW_TYPE_IPADDR) { \ LM_ERR("attribute %d is not of type integer\n", \ _attrs[_attr].v); \ goto error; \
Daniel, what about my previous patch? May be resend with this corrections?
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.8.4-calculate GNU/Linux
Hello,
send a separate patch attached as file. Being the same as integer, I assume PW_TYPE_IPADDR is only of IPv4. Is an equivalent for IPv6?
Cheers, Daniel
On 5/15/13 3:41 PM, Victor V. Kustov wrote:
Hello!
Radius pairs has two similar types: integer and ipaddr. generate_avps In modules/misc_radius/functions.c, function generate_avps() we see that attribute checked for PW_TYPE_INTEGER (integer) type. That incorrect: when rad attribute has PW_TYPE_IPADDR (for example Framed-IP-Addr) then we raise error, but we must processing ipaddr same as integer.
As result misc_radius cant sent queries with PW_TYPE_IPADDR at all: error "attribute ## not integer" raised.
Need correct this same way:
@@ -142,7 +196,8 @@ static void generate_avps(struct attr *attrs, VALUE_PAIR* received) do { \ if ((_len) != 0) { \ if ((_len) == -1) { \
if (_attrs[_attr].t != PW_TYPE_INTEGER) { \
if (_attrs[_attr].t != PW_TYPE_INTEGER) \
if (_attrs[_attr].t != PW_TYPE_IPADDR) { \ LM_ERR("attribute %d is not of type integer\n", \ _attrs[_attr].v); \ goto error; \
Daniel, what about my previous patch? May be resend with this corrections?
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.8.4-calculate GNU/Linux
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello, Daniel-Constantin!
Hello,
send a separate patch attached as file. Being the same as integer, I assume PW_TYPE_IPADDR is only of IPv4. Is an equivalent for IPv6?
Consider http://www.rfc-editor.org/errata_search.php?rfc=3162
--VERIFIER NOTES-- The common terminology is known by RADIUS implementers. Every RADIUS implementor "knows what this means". i.e. "Address" in RFC 2865 means "ipaddr", and "Address" in RFC 3162 means "ipv6addr".
As we see it different types. In current parsing misc_radius just skip all attributes except string, integer, ipaddr with warning ("attribute %d is not of type integer").
I think need complete support for all attributes types with typecast in avp's: integer and string.
Maybe part of typecasts will useful in common transformations.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.8.4-calculate GNU/Linux
Hello,
if you send a patch, we will review and commit appropriately.
There should be a way to detect is ipv4 or ipv6, because at least the size is different. In kamailio AVPs it should be stored as string ...
Cheers, Daniel
On 5/17/13 2:46 PM, Victor V. Kustov wrote:
Hello, Daniel-Constantin!
Hello,
send a separate patch attached as file. Being the same as integer, I assume PW_TYPE_IPADDR is only of IPv4. Is an equivalent for IPv6?
Consider http://www.rfc-editor.org/errata_search.php?rfc=3162
--VERIFIER NOTES-- The common terminology is known by RADIUS implementers. Every RADIUS implementor "knows what this means". i.e. "Address" in RFC 2865 means "ipaddr", and "Address" in RFC 3162 means "ipv6addr".
As we see it different types. In current parsing misc_radius just skip all attributes except string, integer, ipaddr with warning ("attribute %d is not of type integer").
I think need complete support for all attributes types with typecast in avp's: integer and string.
Maybe part of typecasts will useful in common transformations.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.8.4-calculate GNU/Linux
Hello, Daniel-Constantin!
I see attached two patches:
docs.patch - some documentation changes
functions.patch: + patch 'bout IPv4 (ipaddr) attributes + in radius_load_callee_avps/radius_load_caller_avps when common_response set 1, avp's set even in negative radius response (usable for error handle).
Looks like I successfully combine kamailio and abills via radius.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.2-calculate GNU/Linux
Hello,
the patches were applied. Give another try to be sure it works fine, as I put there recommended indentation (tabs, not whitespaces) and hopefully nothing else was touched.
Cheers, Daniel
On 5/24/13 11:28 AM, Victor V. Kustov wrote:
Hello, Daniel-Constantin!
I see attached two patches:
docs.patch - some documentation changes
functions.patch:
- patch 'bout IPv4 (ipaddr) attributes
- in radius_load_callee_avps/radius_load_caller_avps when common_response set 1, avp's set even in negative radius response (usable for error handle).
Looks like I successfully combine kamailio and abills via radius.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.2-calculate GNU/Linux
Hello, Daniel-Constantin!
Hello,
the patches were applied. Give another try to be sure it works fine,
thanks. misc_radius works fine.
as I put there recommended indentation (tabs, not whitespaces) and hopefully nothing else was touched.
ok, tabs.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.2-calculate GNU/Linux