]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_ptm.c
zebra: let /32 host route with same IP cross VRF
[mirror_frr.git] / zebra / zebra_ptm.c
index c237133130ed9eff83a9095518538c63073dbb55..68e5c391cf861a1b706c187d630f3218bf609538 100644 (file)
@@ -100,7 +100,7 @@ static ptm_lib_handle_t *ptm_hdl;
 struct zebra_ptm_cb ptm_cb;
 
 static int zebra_ptm_socket_init(void);
-int zebra_ptm_sock_read(struct thread *);
+void zebra_ptm_sock_read(struct thread *thread);
 static void zebra_ptm_install_commands(void);
 static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt);
 void zebra_bfd_peer_replay_req(void);
@@ -168,12 +168,12 @@ void zebra_ptm_finish(void)
                close(ptm_cb.ptm_sock);
 }
 
-static int zebra_ptm_flush_messages(struct thread *thread)
+static void zebra_ptm_flush_messages(struct thread *thread)
 {
        ptm_cb.t_write = NULL;
 
        if (ptm_cb.ptm_sock == -1)
-               return -1;
+               return;
 
        errno = 0;
 
@@ -187,7 +187,7 @@ static int zebra_ptm_flush_messages(struct thread *thread)
                ptm_cb.t_timer = NULL;
                thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
                                 ptm_cb.reconnect_time, &ptm_cb.t_timer);
-               return -1;
+               return;
        case BUFFER_PENDING:
                ptm_cb.t_write = NULL;
                thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL,
@@ -196,8 +196,6 @@ static int zebra_ptm_flush_messages(struct thread *thread)
        case BUFFER_EMPTY:
                break;
        }
-
-       return 0;
 }
 
 static int zebra_ptm_send_message(char *data, int size)
@@ -226,7 +224,7 @@ static int zebra_ptm_send_message(char *data, int size)
        return 0;
 }
 
-int zebra_ptm_connect(struct thread *t)
+void zebra_ptm_connect(struct thread *t)
 {
        int init = 0;
 
@@ -255,8 +253,6 @@ int zebra_ptm_connect(struct thread *t)
        } else if (ptm_cb.reconnect_time >= ZEBRA_PTM_RECONNECT_TIME_MAX) {
                ptm_cb.reconnect_time = ZEBRA_PTM_RECONNECT_TIME_INITIAL;
        }
-
-       return (errno);
 }
 
 DEFUN (zebra_ptm_enable,
@@ -649,7 +645,7 @@ static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt)
        }
 }
 
-int zebra_ptm_sock_read(struct thread *thread)
+void zebra_ptm_sock_read(struct thread *thread)
 {
        int sock;
        int rc;
@@ -658,7 +654,7 @@ int zebra_ptm_sock_read(struct thread *thread)
        sock = THREAD_FD(thread);
 
        if (sock == -1)
-               return -1;
+               return;
 
        /* PTM communicates in CSV format */
        do {
@@ -679,14 +675,12 @@ int zebra_ptm_sock_read(struct thread *thread)
                thread_add_timer(zrouter.master, zebra_ptm_connect, NULL,
                                 ptm_cb.reconnect_time,
                                 &ptm_cb.t_timer);
-               return -1;
+               return;
        }
 
        ptm_cb.t_read = NULL;
        thread_add_read(zrouter.master, zebra_ptm_sock_read, NULL,
                        ptm_cb.ptm_sock, &ptm_cb.t_read);
-
-       return 0;
 }
 
 /* BFD peer/dst register/update */
@@ -1380,7 +1374,7 @@ static int _zebra_ptm_bfd_client_deregister(struct zserv *zs)
        }
 
        /*
-        * The message type will be BFD_DEST_REPLY so we can use only
+        * The message type will be ZEBRA_BFD_DEST_REPLAY so we can use only
         * one callback at the `bfdd` side, however the real command
         * number will be included right after the zebra header.
         */