Re: [PATCH 1/4] xfrm: increment genid before bumping state genids
From: Timo Teräs <hidden>
Date: 2010-03-31 10:55:15
Herbert Xu wrote:
On Wed, Mar 31, 2010 at 01:17:03PM +0300, Timo Teras wrote:quoted
__xfrm_state_bump_genids() is used to update the genid of all matching xfrm_state's, so any bundle using the state would get refreshed with the newly inserted state. However, since __xfrm_state_bump_genids() is called before the __xfrm_state_insert() which actually bumps the genid counter, it is possible that the genid was not updated at all (if there was no state inserts previously). This is fixed by moving the genid incrementation to __xfrm_state_bump_genids() so the older states are guaranteed to get different genid. Signed-off-by: Timo Teras <redacted>It would appear that not all xfrm_state_insert calls are preceded by xfrm_state_bump_genids so this patch isn't correct.
Yes, I noticed that there's one. But __xfrm_state_insert() is called to replace an acquire in that case. Acquires are never used in bundle, so this is good. But maybe it'd be more explicit if the genid increment is done before each __xfrm_state_insert()?