From f94cd4b518ce42beaee15b9f2069cd3c991388a4 Mon Sep 17 00:00:00 2001 From: Rein Tollevik Date: Sun, 6 Jul 2008 14:15:42 +0000 Subject: [PATCH] ITS#5597 fix CSN compare when provider has CSNs with other sids. --- servers/slapd/syncrepl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index fd8847727c..a3164aeb36 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -689,8 +689,8 @@ compare_csns( struct sync_cookie *sc1, struct sync_cookie *sc2, int *which ) return -1; } - for (i=0; inumcsns; i++) { - for (j=0; jnumcsns; j++) { + for (j=0; jnumcsns; j++) { + for (i=0; inumcsns; i++) { if ( sc1->sids[i] != sc2->sids[j] ) continue; value_match( &match, slap_schema.si_ad_entryCSN, @@ -703,6 +703,11 @@ compare_csns( struct sync_cookie *sc1, struct sync_cookie *sc2, int *which ) } break; } + if ( i == sc1->numcsns ) { + /* sc2 has a sid sc1 lacks */ + *which = j; + return -1; + } } return match; } -- 2.39.5