summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-09-17 12:57:49 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-09-17 12:57:49 +0000
commit0ae3e22361c9d7a7ff1cc8532095f5f3975448b5 (patch)
tree11d7292af0b9eb87438c701eb9488c732acb3b23
parent403fafa13e85fa0e647b81313341cdb7d7aed68e (diff)
logging of replymsg, patch from Arne Schwabe
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@389 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 5775f0c..4a02197 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -6,6 +6,11 @@
* copyright notice and this permission notice appear in all copies.
*/
+/* Code contributions from:
+ *
+ * Arne Schwabe <schwabe at uni-paderborn.de>
+ */
+
/* For UDP there is one server instance consisting of udpserverrd and udpserverth
* rd is responsible for init and launching wr
* For TLS there is a server instance that launches tlsserverrd for each TLS peer
@@ -1890,7 +1895,7 @@ void replyh(struct server *server, unsigned char *buf) {
struct rqout *rqout;
int sublen;
unsigned char *subattrs;
- uint8_t *username, *stationid;
+ uint8_t *username, *stationid, *replymsg;
struct radmsg *msg = NULL;
struct tlv *attr;
struct list_node *node;
@@ -1965,12 +1970,25 @@ void replyh(struct server *server, unsigned char *buf) {
username = radattr2ascii(radmsg_gettype(rqout->rq->msg, RAD_Attr_User_Name));
if (username) {
stationid = radattr2ascii(radmsg_gettype(rqout->rq->msg, RAD_Attr_Calling_Station_Id));
+ replymsg = radattr2ascii(radmsg_gettype(msg, RAD_Attr_Reply_Message));
if (stationid) {
- debug(DBG_INFO, "%s for user %s stationid %s from %s",
- radmsgtype2string(msg->code), username, stationid, server->conf->host);
+ if (replymsg) {
+ debug(DBG_INFO, "%s for user %s stationid %s from %s (%s)",
+ radmsgtype2string(msg->code), username, stationid, server->conf->host, replymsg);
+ free(replymsg);
+ } else
+ debug(DBG_INFO, "%s for user %s stationid %s from %s",
+ radmsgtype2string(msg->code), username, stationid, server->conf->host);
free(stationid);
- } else
- debug(DBG_INFO, "%s for user %s from %s", radmsgtype2string(msg->code), username, server->conf->host);
+ } else {
+ if (replymsg) {
+ debug(DBG_INFO, "%s for user %s from %s (%s)",
+ radmsgtype2string(msg->code), username, server->conf->host, replymsg);
+ free(replymsg);
+ } else
+ debug(DBG_INFO, "%s for user %s from %s",
+ radmsgtype2string(msg->code), username, server->conf->host);
+ }
free(username);
}
}