]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: add timestamp to bgp_adj_in
authorDavid Lamparter <equinox@diac24.net>
Wed, 17 Jul 2019 13:24:28 +0000 (15:24 +0200)
committerDavid Lamparter <equinox@diac24.net>
Fri, 30 Aug 2019 17:00:45 +0000 (19:00 +0200)
If we reject a received update in a filter, it never turns into a
bgp_path_info but stays in adj_in.  For that case, we don't have any
timestamp for the update.

Currently, this isn't visible anywhere; BMP will make use of this
timestamp (and we can add a CLI option if we want.)

Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd/bgp_advertise.c
bgpd/bgp_advertise.h

index 497fb0749e19063c9703bfa11fbf378695dbe182..76a65f7f04b50fdaefb131f3d289da87b4acfbf2 100644 (file)
@@ -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);
index 1b55b6e64b425f0de4c7daecf4b9e04924943726..c983598756e90612f69cb9b463204762a1892b26 100644 (file)
@@ -101,6 +101,9 @@ struct bgp_adj_in {
        /* Received attribute.  */
        struct attr *attr;
 
+       /* timestamp (monotime) */
+       time_t uptime;
+
        /* Addpath identifier */
        uint32_t addpath_rx_id;
 };