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

From: pravin b shelar <[email-masked]>
Date: Tue, 24 May 2005 12:16:38 +0530

Herbert Xu wrote:

>On Mon, May 23, 2005 at 05:56:39PM +0530, pravin wrote:
>  
>
>>        	/* 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.