Thread (6 messages) 6 messages, 3 authors, 2005-05-26

Re: [PATCH] : bug fix in multipath drr code.

From: pravin b shelar <hidden>
Date: 2005-05-24 06:46:38

Herbert Xu wrote:
On Mon, May 23, 2005 at 05:56:39PM +0530, pravin wrote:
 
quoted
       	/* if necessary and possible utilize the old alternative */
-	if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&
-	    last_selection != NULL) {
-		result = last_selection;
-		*rp = result;
-		return;
+	if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 ) {
+		struct rtable *last_result = last_selection;
+		if(last_result != NULL &&
+		   multipath_comparekeys(&last_result->fl, flp)) {
+			*rp = last_result;
+			return;
+		}
	}
   
You don't need all this code.  All you need to do is do
result = last_selection before the if condition and then
check result in the if condition instead of last_selection.

The multipath_comparekeys isn't necessary either.

 
In concurrent invocations of drr_select_route() last_selection will
change to different route.
So in that case we can not  use last_selection route on basis of
FLOWI_FLAG_MULTIPATHOLDROUTE flag only, since old
route might be totally different due another invocation of same function.
So, I think multipath_comparekeys is necessary.

Please correct me if I am wrong.

Regards,
Pravin.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help