]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_keepalives.c
bgpd: reuse bgp_path_info_extra_free() routing in rfapi
[mirror_frr.git] / bgpd / bgp_keepalives.c
index f81836cc836083558c9cacae1b03d5c4c22ec1e2..50aad70ddc56fd70eb5ea32d4292e8b13cd29d33 100644 (file)
@@ -123,10 +123,11 @@ static void peer_process(struct hash_backet *hb, void *arg)
                *next_update = diff;
 }
 
-static int peer_hash_cmp(const void *f, const void *s)
+static bool peer_hash_cmp(const void *f, const void *s)
 {
        const struct pkat *p1 = f;
        const struct pkat *p2 = s;
+
        return p1->peer == p2->peer;
 }
 
@@ -180,11 +181,7 @@ void *bgp_keepalives_start(void *arg)
        pthread_cond_init(peerhash_cond, &attrs);
        pthread_condattr_destroy(&attrs);
 
-#ifdef GNU_LINUX
-       pthread_setname_np(fpt->thread, "bgpd_ka");
-#elif defined(OPEN_BSD)
-       pthread_set_name_np(fpt->thread, "bgpd_ka");
-#endif
+       frr_pthread_set_name(fpt, NULL, "bgpd_ka");
 
        /* initialize peer hashtable */
        peerhash = hash_create_size(2048, peer_hash_key, peer_hash_cmp, NULL);
@@ -233,7 +230,7 @@ void bgp_keepalives_on(struct peer *peer)
        if (CHECK_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON))
                return;
 
-       struct frr_pthread *fpt = frr_pthread_get(PTHREAD_KEEPALIVES);
+       struct frr_pthread *fpt = bgp_pth_ka;
        assert(fpt->running);
 
        /* placeholder bucket data to use for fast key lookups */
@@ -263,7 +260,7 @@ void bgp_keepalives_off(struct peer *peer)
        if (!CHECK_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON))
                return;
 
-       struct frr_pthread *fpt = frr_pthread_get(PTHREAD_KEEPALIVES);
+       struct frr_pthread *fpt = bgp_pth_ka;
        assert(fpt->running);
 
        /* placeholder bucket data to use for fast key lookups */