Shorter way to accomplish the same
authorkolla <kolla>
Fri, 3 Apr 2009 15:37:47 +0000 (15:37 +0000)
committerkolla <kolla@e88ac4ed-0b26-0410-9574-a7f39faa03bf>
Fri, 3 Apr 2009 15:37:47 +0000 (15:37 +0000)
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@500 e88ac4ed-0b26-0410-9574-a7f39faa03bf

radsecproxy.c

index 2ec1f36..be5730b 100644 (file)
@@ -1676,14 +1676,8 @@ void replyh(struct server *server, unsigned char *buf) {
     if (ttlres == -1 && (options.addttl || from->conf->addttl))
        addttlattr(msg, options.ttlattrtype, from->conf->addttl ? from->conf->addttl : options.addttl);
 
-    if (msg->code == RAD_Access_Accept)
-           debug(DBG_WARN, "replyh: passing Access_Accept to client %s (%s)", from->conf->name, addr2string(from->addr));
-    else if (msg->code == RAD_Access_Reject)
-           debug(DBG_WARN, "replyh: passing Access_Reject to client %s (%s)", from->conf->name, addr2string(from->addr));
-    else if (msg->code == RAD_Accounting_Response)
-           debug(DBG_WARN, "replyh: passing Accounting_Response to client %s (%s)", from->conf->name, addr2string(from->addr));
-    else
-           debug(DBG_INFO, "replyh: passing reply to client %s (%s)", from->conf->name, addr2string(from->addr));
+    debug(msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject || msg->code == RAD_Accounting_Response ? DBG_WARN : DBG_INFO,
+       "replyh: passing %s to client %s (%s)", radmsgtype2string(msg->code), from->conf->name, addr2string(from->addr));
 
     radmsg_free(rqout->rq->msg);
     rqout->rq->msg = msg;