]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed previously untested paths in RPKI
authorMaria Matejka <mq@ucw.cz>
Tue, 4 Oct 2022 11:20:04 +0000 (13:20 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 5 Oct 2022 14:33:34 +0000 (16:33 +0200)
nest/proto.c
sysdep/unix/io-loop.c
sysdep/unix/io.c

index 319b35dd754f8d2700e1f18bf82aff02595f2d4f..2f3515b92e9fbfe9bb33ebb0341e933cccec37d2 100644 (file)
@@ -355,7 +355,7 @@ channel_export_one_roa(struct rt_export_request *req, const net_addr *net UNUSED
   struct roa_subscription *s = SKIP_BACK(struct roa_subscription, req, req);
 
   /* TODO: use the information about what roa has changed */
-  settle_kick(&s->settle, &main_birdloop);
+  settle_kick(&s->settle, s->c->proto->loop);
 
   rpe_mark_seen_all(req->hook, first, NULL);
 }
index dbca36e9bfd093658b5527f8d467a588e24f546c..b588b73644bc8c3741f2e9932aded9b3c58dce46 100644 (file)
@@ -252,6 +252,9 @@ sk_start(sock *s)
 static void
 sockets_remove(struct birdloop *loop, sock *s)
 {
+  if (!enlisted(&s->n))
+    return;
+
   rem_node(&s->n);
   loop->sock_num--;
 
index 6454f15fa7be0f3e989fef56bf0944b8de855d37..d4a3d79822b82d36026bf3561602ae954cb96aba 100644 (file)
@@ -774,8 +774,7 @@ sk_ssh_free(sock *s)
 
   if (ssh->channel)
   {
-    if (ssh_channel_is_open(ssh->channel))
-      ssh_channel_close(ssh->channel);
+    ssh_channel_close(ssh->channel);
     ssh_channel_free(ssh->channel);
     ssh->channel = NULL;
   }
@@ -1153,33 +1152,34 @@ sk_ssh_connect(sock *s)
       int server_identity_is_ok = 1;
 
       /* Check server identity */
-      switch (ssh_is_server_known(s->ssh->session))
+      switch (ssh_session_is_known_server(s->ssh->session))
       {
 #define LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s,msg,args...) log(L_WARN "SSH Identity %s@%s:%u: " msg, (s)->ssh->username, (s)->host, (s)->dport, ## args);
-      case SSH_SERVER_KNOWN_OK:
+      case SSH_KNOWN_HOSTS_OK:
        /* The server is known and has not changed. */
        break;
 
-      case SSH_SERVER_NOT_KNOWN:
+      case SSH_KNOWN_HOSTS_UNKNOWN:
        LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s, "The server is unknown, its public key was not found in the known host file %s", s->ssh->server_hostkey_path);
+       server_identity_is_ok = 0;
        break;
 
-      case SSH_SERVER_KNOWN_CHANGED:
+      case SSH_KNOWN_HOSTS_CHANGED:
        LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s, "The server key has changed. Either you are under attack or the administrator changed the key.");
        server_identity_is_ok = 0;
        break;
 
-      case SSH_SERVER_FILE_NOT_FOUND:
+      case SSH_KNOWN_HOSTS_NOT_FOUND:
        LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s, "The known host file %s does not exist", s->ssh->server_hostkey_path);
        server_identity_is_ok = 0;
        break;
 
-      case SSH_SERVER_ERROR:
+      case SSH_KNOWN_HOSTS_ERROR:
        LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s, "Some error happened");
        server_identity_is_ok = 0;
        break;
 
-      case SSH_SERVER_FOUND_OTHER:
+      case SSH_KNOWN_HOSTS_OTHER:
        LOG_WARN_ABOUT_SSH_SERVER_VALIDATION(s, "The server gave use a key of a type while we had an other type recorded. " \
                                             "It is a possible attack.");
        server_identity_is_ok = 0;