sending old reply when receiving duplicated message
authorvenaas <venaas>
Thu, 18 Sep 2008 13:59:03 +0000 (13:59 +0000)
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>
Thu, 18 Sep 2008 13:59:03 +0000 (13:59 +0000)
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@393 e88ac4ed-0b26-0410-9574-a7f39faa03bf

radsecproxy.c
udp.c

index 3dc3903..9a35c21 100644 (file)
@@ -1729,15 +1729,12 @@ int addclientrq(struct request *rq) {
        if (rq->udpport == r->udpport && !memcmp(rq->rqauth, r->rqauth, 16)) {
            gettimeofday(&now, NULL);
            if (now.tv_sec - r->created.tv_sec < r->from->conf->dupinterval) {
-#if 0
-               later       
-                   if (r->replybuf) {
-                       debug(DBG_INFO, "radsrv: already sent reply to request with id %d from %s, resending", rq->rqid, addr2string(r->from->addr));
-                       r->refcount++;
-                       sendreply(r);
-                   } else
-#endif         
-                       debug(DBG_INFO, "radsrv: already got request with id %d from %s, ignoring", rq->rqid, addr2string(r->from->addr));
+               if (r->replybuf) {
+                   debug(DBG_INFO, "addclientrq: already sent reply to request with id %d from %s, resending", rq->rqid, addr2string(r->from->addr));
+                   r->refcount++;
+                   sendreply(r);
+               } else
+                   debug(DBG_INFO, "addclientrq: already got request with id %d from %s, ignoring", rq->rqid, addr2string(r->from->addr));
                return 0;
            }
        }
diff --git a/udp.c b/udp.c
index 05e7a6b..bc239bc 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -208,6 +208,7 @@ void *udpserverwr(void *arg) {
        port_set((struct sockaddr *)&to, reply->udpport);
        if (sendto(reply->udpsock, reply->replybuf, RADLEN(reply->replybuf), 0, (struct sockaddr *)&to, SOCKADDR_SIZE(to)) < 0)
            debug(DBG_WARN, "udpserverwr: send failed");
+       debug(DBG_DBG, "udpserverwr: refcount %d", reply->refcount);
        freerq(reply);
     }
 }