Return success after updating peer. Additional debug messages.
authorJennifer Richards <jennifer@painless-security.com>
Thu, 8 Sep 2016 17:53:25 +0000 (13:53 -0400)
committerJennifer Richards <jennifer@painless-security.com>
Thu, 8 Sep 2016 18:51:00 +0000 (14:51 -0400)
trp/trp_rtable.c
trp/trps.c

index 6919241..37fee17 100644 (file)
@@ -201,6 +201,11 @@ int trp_route_is_local(TRP_ROUTE *entry)
 
 void trp_route_set_triggered(TRP_ROUTE *entry, int trig)
 {
+  tr_debug("trp_route_set_triggered: setting route to %.*s/%.*s through %.*s to %s",
+           entry->comm->len, entry->comm->buf,
+           entry->realm->len, entry->realm->buf,
+           entry->peer->len, entry->peer->buf,
+           trig ? "triggered" : "not triggered");
   entry->triggered=trig;
 }
 
index f770e1c..705ccfb 100644 (file)
@@ -1026,7 +1026,10 @@ static TRP_RC trps_update_one_peer(TRPS_INSTANCE *trps,
     encoded=NULL;
     trp_upd_free(upd);
     upd=NULL;
-  }
+  } else if (n_updates==0)
+    tr_debug("trps_update_one_peer: no updates for %.*s", peer_label->len, peer_label->buf);
+
+  rc=TRP_SUCCESS;
 
 cleanup:
   talloc_free(tmp_ctx);
@@ -1062,7 +1065,8 @@ TRP_RC trps_update(TRPS_INSTANCE *trps, TRP_UPDATE_TYPE update_type)
     }
     rc=trps_update_one_peer(trps, peer, update_type, NULL, NULL);
   }
-  
+
+  tr_debug("trps_update: rc=%u after attempting update.", rc);
   trp_ptable_iter_free(iter);
   trp_rtable_clear_triggered(trps->rtable); /* don't re-send triggered updates */
   talloc_free(tmp_ctx);