]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_advertise.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / bgpd / bgp_advertise.c
index 05eeeca1564ba7459f29fe39fca42a191b37d5ce..8d1c83cf5f4650d9655e486d1fd691e434598ff0 100644 (file)
@@ -64,9 +64,9 @@ static void *baa_hash_alloc(void *p)
        return baa;
 }
 
-unsigned int baa_hash_key(void *p)
+unsigned int baa_hash_key(const void *p)
 {
-       struct bgp_advertise_attr *baa = (struct bgp_advertise_attr *)p;
+       const struct bgp_advertise_attr *baa = p;
 
        return attrhash_key_make(baa->attr);
 }
@@ -194,6 +194,7 @@ void bgp_adj_in_set(struct bgp_node *rn, struct peer *peer, struct attr *attr,
        adj = XCALLOC(MTYPE_BGP_ADJ_IN, sizeof(struct bgp_adj_in));
        adj->peer = peer_lock(peer); /* adj_in peer reference */
        adj->attr = bgp_attr_intern(attr);
+       adj->uptime = bgp_clock();
        adj->addpath_rx_id = addpath_id;
        BGP_ADJ_IN_ADD(rn, adj);
        bgp_lock_node(rn);
@@ -241,9 +242,9 @@ void bgp_sync_init(struct peer *peer)
        FOREACH_AFI_SAFI (afi, safi) {
                sync = XCALLOC(MTYPE_BGP_SYNCHRONISE,
                               sizeof(struct bgp_synchronize));
-               BGP_ADV_FIFO_INIT(&sync->update);
-               BGP_ADV_FIFO_INIT(&sync->withdraw);
-               BGP_ADV_FIFO_INIT(&sync->withdraw_low);
+               bgp_adv_fifo_init(&sync->update);
+               bgp_adv_fifo_init(&sync->withdraw);
+               bgp_adv_fifo_init(&sync->withdraw_low);
                peer->sync[afi][safi] = sync;
        }
 }
@@ -255,6 +256,5 @@ void bgp_sync_delete(struct peer *peer)
 
        FOREACH_AFI_SAFI (afi, safi) {
                XFREE(MTYPE_BGP_SYNCHRONISE, peer->sync[afi][safi]);
-               peer->sync[afi][safi] = NULL;
        }
 }