]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - proto/rpki/rpki.c
Merge remote-tracking branch 'origin/master' into haugesund-to-2.0
[thirdparty/bird.git] / proto / rpki / rpki.c
index ab0837f30abe76e4f7d7acd6a5f8a94bcdb498f4..4fca9e546a4280c43645eee688c4a2bad4bcd62c 100644 (file)
@@ -121,18 +121,18 @@ rpki_table_add_roa(struct rpki_cache *cache, struct channel *channel, const net_
   struct rpki_proto *p = cache->p;
 
   rta a0 = {
-    .src = p->p.main_source,
+    .pref = channel->preference,
     .source = RTS_RPKI,
     .scope = SCOPE_UNIVERSE,
     .dest = RTD_NONE,
   };
 
   rta *a = rta_lookup(&a0);
-  rte *e = rte_get_temp(a);
+  rte *e = rte_get_temp(a, p->p.main_source);
 
   e->pflags = 0;
 
-  rte_update2(channel, &pfxr->n, e, a0.src);
+  rte_update2(channel, &pfxr->n, e, e->src);
 }
 
 void
@@ -828,16 +828,27 @@ rpki_show_proto_info(struct proto *P)
   if (cache)
   {
     const char *transport_name = "---";
+    uint default_port = 0;
 
     switch (cf->tr_config.type)
     {
 #if HAVE_LIBSSH
-    case RPKI_TR_SSH: transport_name = "SSHv2"; break;
+    case RPKI_TR_SSH:
+      transport_name = "SSHv2";
+      default_port = RPKI_SSH_PORT;
+      break;
 #endif
-    case RPKI_TR_TCP: transport_name = "Unprotected over TCP"; break;
+    case RPKI_TR_TCP:
+      transport_name = "Unprotected over TCP";
+      default_port = RPKI_TCP_PORT;
+      break;
     };
 
     cli_msg(-1006, "  Cache server:     %s", cf->hostname);
+
+    if (cf->port != default_port)
+      cli_msg(-1006, "  Cache port:       %u", cf->port);
+
     cli_msg(-1006, "  Status:           %s", rpki_cache_state_to_str(cache->state));
     cli_msg(-1006, "  Transport:        %s", transport_name);
     cli_msg(-1006, "  Protocol version: %u", cache->version);
@@ -949,3 +960,9 @@ struct protocol proto_rpki = {
   .reconfigure =       rpki_reconfigure,
   .get_status =        rpki_get_status,
 };
+
+void
+rpki_build(void)
+{
+  proto_build(&proto_rpki);
+}