]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_network.c
Merge pull request #10904 from mobash-rasool/fixes
[mirror_frr.git] / bgpd / bgp_network.c
index 09abb699683de1212ef8117543389da1ff2d9d6c..0c325b67815b699dc956178bbc556bc55f16a781 100644 (file)
@@ -52,15 +52,6 @@ extern struct zebra_privs_t bgpd_privs;
 
 static char *bgp_get_bound_name(struct peer *peer);
 
-/* BGP listening socket. */
-struct bgp_listener {
-       int fd;
-       union sockunion su;
-       struct thread *thread;
-       struct bgp *bgp;
-       char *name;
-};
-
 void bgp_dump_listener_info(struct vty *vty)
 {
        struct listnode *node;
@@ -351,7 +342,7 @@ static void bgp_socket_set_buffer_size(const int fd)
 }
 
 /* Accept bgp connection. */
-static int bgp_accept(struct thread *thread)
+static void bgp_accept(struct thread *thread)
 {
        int bgp_sock;
        int accept_sock;
@@ -372,7 +363,7 @@ static int bgp_accept(struct thread *thread)
                flog_err_sys(EC_LIB_SOCKET,
                             "[Error] BGP accept socket fd is negative: %d",
                             accept_sock);
-               return -1;
+               return;
        }
 
        thread_add_read(bm->master, bgp_accept, listener, accept_sock,
@@ -411,7 +402,7 @@ static int bgp_accept(struct thread *thread)
                                "[Error] BGP socket accept failed (%s); retrying",
                                safe_strerror(save_errno));
                }
-               return -1;
+               return;
        }
        set_nonblocking(bgp_sock);
 
@@ -427,7 +418,7 @@ static int bgp_accept(struct thread *thread)
                                "[Event] Could not get instance for incoming conn from %s",
                                inet_sutop(&su, buf));
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        bgp_socket_set_buffer_size(bgp_sock);
@@ -460,7 +451,7 @@ static int bgp_accept(struct thread *thread)
                                                      TCP_connection_open);
                        }
 
-                       return 0;
+                       return;
                }
        }
 
@@ -472,7 +463,7 @@ static int bgp_accept(struct thread *thread)
                                VRF_LOGNAME(vrf_lookup_by_id(bgp->vrf_id)));
                }
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        if (CHECK_FLAG(peer1->flags, PEER_FLAG_SHUTDOWN)
@@ -483,7 +474,7 @@ static int bgp_accept(struct thread *thread)
                                inet_sutop(&su, buf), bgp->name_pretty, bgp->as,
                                VRF_LOGNAME(vrf_lookup_by_id(bgp->vrf_id)));
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        /*
@@ -498,7 +489,7 @@ static int bgp_accept(struct thread *thread)
                                "[Event] Closing incoming conn for %s (%p) state %d",
                                peer1->host, peer1, peer1->status);
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        /* Check that at least one AF is activated for the peer. */
@@ -508,7 +499,7 @@ static int bgp_accept(struct thread *thread)
                                "%s - incoming conn rejected - no AF activated for peer",
                                peer1->host);
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        /* Do not try to reconnect if the peer reached maximum
@@ -521,7 +512,7 @@ static int bgp_accept(struct thread *thread)
                                "[Event] Incoming BGP connection rejected from %s due to maximum-prefix or shutdown",
                                peer1->host);
                close(bgp_sock);
-               return -1;
+               return;
        }
 
        if (bgp_debug_neighbor_events(peer1))
@@ -609,8 +600,6 @@ static int bgp_accept(struct thread *thread)
         * massage the event system to make things happy
         */
        bgp_nht_interface_events(peer);
-
-       return 0;
 }
 
 /* BGP socket bind. */