[Asterisk-code-review] cel/cel radius: Fix wrong pointer. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed Jan 6 06:07:49 CST 2016


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/1921

Change subject: cel/cel_radius: Fix wrong pointer.
......................................................................

cel/cel_radius: Fix wrong pointer.

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
---
M cel/cel_radius.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/1921/1

diff --git a/cel/cel_radius.c b/cel/cel_radius.c
index 79caf22..7b41887 100644
--- a/cel/cel_radius.c
+++ b/cel/cel_radius.c
@@ -95,7 +95,7 @@
 
 #define RADIUS_BACKEND_NAME "CEL Radius Logging"
 
-#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)
 {
@@ -176,7 +176,7 @@
 	/* 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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/1921
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72889bccd8fde120d47aa659edc0e7e6d4d019f0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Aaron An <anjb at ti-net.com.cn>



More information about the asterisk-code-review mailing list