diff extensions/app_radgw/rgw_clients.c @ 550:4c935aecee6c

Hide and automate the Proxy-State attributes management in RADIUS gateway
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 15 Sep 2010 14:24:45 +0900
parents 345537783a90
children 153cd2600fcf
line wrap: on
line diff
--- a/extensions/app_radgw/rgw_clients.c	Wed Sep 15 10:44:46 2010 +0900
+++ b/extensions/app_radgw/rgw_clients.c	Wed Sep 15 14:24:45 2010 +0900
@@ -974,6 +974,20 @@
 		return ENOTSUP;
 	}
 	
+	/* Add all the Proxy-States back in the message */
+	for (p = 0; p < req->ps_nb; p++) {
+		struct radius_attr_hdr * attr = (struct radius_attr_hdr *)(req->radius.buf + req->radius.attr_pos[req->ps_first + p]);
+		
+		if (radius_msg_add_attr_to_array(*msg, attr)) {
+			TRACE_DEBUG(INFO, "Error in radius_msg_add_attr_to_array, ENOMEM");
+			radius_msg_free(*msg);
+			free(*msg);
+			*msg = NULL;
+			return ENOMEM;
+		}
+	}
+	
+	/* Add the Message-Authenticator if needed, and other final tasks */
 	if (radius_msg_finish_srv(*msg, cli->key.data, cli->key.len, req->radius.hdr->authenticator)) {
 		TRACE_DEBUG(INFO, "An error occurred while preparing the RADIUS answer");
 		radius_msg_free(*msg);
"Welcome to our mercurial repository"