]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cel/cel_radius: Fix wrong pointer. 22/1922/1
authorAaron An <anjb@ti-net.com.cn>
Mon, 4 Jan 2016 10:26:55 +0000 (18:26 +0800)
committerJoshua Colp <jcolp@digium.com>
Wed, 6 Jan 2016 12:07:58 +0000 (06:07 -0600)
The macro ADD_VENDOR_CODE defined in the cel_radius.c should use the parameter
y not the address of y.

I capture the radius UDP packet via tcpdump, and the AV pairs are not correct,
then i review the source code and compare it with cdr/cdr_radius.c. Fix it and
 it works.

ASTERISK-25647 #close
Reported by: Aaron An
Tested by: Aaron An

Change-Id: I72889bccd8fde120d47aa659edc0e7e6d4d019f0

cel/cel_radius.c

index f69b9736a2c09e5d863210c8e106dda7230c8540..db0acfb42f78d37f9d8998551fb025a20f89a671 100644 (file)
@@ -94,7 +94,7 @@ static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOG
 static rc_handle *rh = NULL;
 static struct ast_event_sub *event_sub = NULL;
 
-#define ADD_VENDOR_CODE(x,y) (rc_avpair_add(rh, send, x, &y, strlen(y), VENDOR_CODE))
+#define ADD_VENDOR_CODE(x,y) (rc_avpair_add(rh, send, x, (void *)y, strlen(y), VENDOR_CODE))
 
 static int build_radius_record(VALUE_PAIR **send, struct ast_cel_event_record *record)
 {
@@ -175,7 +175,7 @@ static int build_radius_record(VALUE_PAIR **send, struct ast_cel_event_record *r
        /* Setting Acct-Session-Id & User-Name attributes for proper generation
           of Acct-Unique-Session-Id on server side */
        /* Channel */
-       if (!rc_avpair_add(rh, send, PW_USER_NAME, &record->channel_name,
+       if (!rc_avpair_add(rh, send, PW_USER_NAME, (void *)record->channel_name,
                        strlen(record->channel_name), 0)) {
                return -1;
        }