Change Order of Sync Monitor in nlsr.c
diff --git a/nlsr.c b/nlsr.c
index a50c2e3..a498264 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -1375,9 +1375,6 @@
print_adjacent_from_adl();
build_and_install_name_lsas();
- res=sync_monitor(nlsr->topo_prefix,nlsr->slice_prefix);
- ON_ERROR_DESTROY(res);
-
print_name_lsdb();
if ( nlsr->cor_r != -1.0 && nlsr->cor_theta != -1.0)
{
@@ -1389,6 +1386,9 @@
ccn_set_schedule(nlsr->ccn,nlsr->sched);
nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 1, &send_info_interest, NULL, 0);
nlsr->event = ccn_schedule_event(nlsr->sched, 60000000, &refresh_lsdb, NULL, 0);
+
+ res=sync_monitor(nlsr->topo_prefix,nlsr->slice_prefix);
+ ON_ERROR_DESTROY(res);
while(1)
diff --git a/nlsr_sync.c b/nlsr_sync.c
index 054810a..7ae108a 100644
--- a/nlsr_sync.c
+++ b/nlsr_sync.c
@@ -642,8 +642,7 @@
sync_monitor(char *topo_prefix, char *slice_prefix)
{
- static struct ccns_name_closure nc={0};
-
+ static struct ccns_name_closure nc={0};
nlsr->closure = &nc;
struct ccn_charbuf *prefix = ccn_charbuf_create();
struct ccn_charbuf *roothash = NULL;
@@ -658,7 +657,6 @@
ccn_charbuf_reset(topo);
ccn_name_from_uri(topo, topo_prefix);
-
ccns_slice_set_topo_prefix(nlsr->slice, topo, prefix);
nlsr->closure->callback = &sync_cb;
nlsr->ccns = ccns_open(nlsr->ccn, nlsr->slice, nlsr->closure, roothash, NULL);