Use new home_server_find API
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Nov 2009 10:53:29 +0000 (11:53 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Nov 2009 10:53:29 +0000 (11:53 +0100)
src/main/event.c
src/main/stats.c

index e4fda3c..42b2ca6 100644 (file)
@@ -1587,7 +1587,7 @@ static int originated_coa_request(REQUEST *request)
                vp = pairfind(coa->proxy->vps, PW_PACKET_DST_PORT);
                if (vp) port = vp->vp_integer;
 
-               coa->home_server = home_server_find(&ipaddr, port);
+               coa->home_server = home_server_find(&ipaddr, port, IPPROTO_UDP);
                if (!coa->home_server) {
                        RDEBUG2("WARNING: Unknown destination %s:%d for CoA request.",
                               inet_ntop(ipaddr.af, &ipaddr.ipaddr,
index 6d5471d..e7b4911 100644 (file)
@@ -66,7 +66,7 @@ void request_stats_final(REQUEST *request)
         *      deleted, because only the main server thread calls
         *      this function, which makes it thread-safe.
         */
-       switch (request->reply->code) {
+       if (request->reply) switch (request->reply->code) {
        case PW_AUTHENTICATION_ACK:
                radius_auth_stats.total_responses++;
                radius_auth_stats.total_access_accepts++;
@@ -564,7 +564,8 @@ void request_stats_reply(REQUEST *request)
                
                ipaddr.af = AF_INET;
                ipaddr.ipaddr.ip4addr.s_addr = server_ip->vp_ipaddr;
-               home = home_server_find(&ipaddr, server_port->vp_integer);
+               home = home_server_find(&ipaddr, server_port->vp_integer,
+                                       IPPROTO_UDP);
 
                /*
                 *      Not found: don't do anything