[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeradius-devel
Subject:    [BUGFIX] Bug in Replicate-To-Realm handling
From:       Vesselin Atanasov <vesselin () bgnet ! bg>
Date:       2001-05-25 1:19:36
[Download RAW message or body]

Hello.
There is a bug in the code handling responses to replicated packets. When
proxy_send() returns 2 meaning that request must be replicated the code in
rad_respond() postpones the request and it is not marked as finished. When
proxy_receive() returns 1 meaning that a reponse to a replicated request
has been received, the current code in rad_respond just jumps to 
next_request, thus leaving the postponed request as unfinished. As a 
result the request stays the queue for its ID and when a new request 
arrives with the same host/port/code/id the freeradius will log a 
"Dropping conflicting authentication packet" message and then drop the new
request. The more requests are served by the NAS the greater is
probability for the bug to show because replicated unfinished requests
accumulate in the queue. Typically on Ascend MAX servers it appears after
2-4 hours. A fix is attached.

Regards,
vesselin

["freeradius-23_May_2001.replicate.patch" (TEXT/PLAIN)]

diff -ru freeradius-23_May_2001.orig/src/main/radiusd.c freeradius-23_May_2001/src/main/radiusd.c
--- freeradius-23_May_2001.orig/src/main/radiusd.c	Tue May 15 22:31:25 2001
+++ freeradius-23_May_2001/src/main/radiusd.c	Fri May 25 03:16:32 2001
@@ -1358,8 +1358,15 @@
 	if (request->proxy) {
 		int replicating;
 		replicating = proxy_receive(request);
-		if (replicating != 0) {
-			goto next_request;
+		switch (replicating) {
+			case -1:
+				/* on error just continue with next request */
+				goto next_request;
+			case 1:
+				/* if this was a replicated request, mark it as
+				 * finished first, because it was postponed
+				 */
+				goto mark_as_finished;
 		}
 	}
 	
@@ -1515,6 +1522,7 @@
 
 	if (request->config_items) pairfree(&request->config_items);
 
+mark_as_finished:
 	DEBUG2("Finished request %d", request->number);
 	finished = TRUE;

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic