--- a/net/xfrm/xfrm_state.c 2006-12-04 12:06:23.000000000 -0500 +++ b/net/xfrm/xfrm_state.c 2006-12-04 12:07:09.000000000 -0500 @@ -1159,11 +1159,12 @@ if (!xfrm_id_proto_match(x->id.proto, proto)) continue; if (last) { - err = func(last, ++count, data); + err = func(last, count, data); if (err) goto out; } last = x; + count++; } } if (count == 0) {