]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: update time of last change when label nexthop entry changed
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 16 Feb 2023 12:46:32 +0000 (13:46 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 9 May 2023 19:00:57 +0000 (21:00 +0200)
A timer attribute is added for each label nexthop entry, in order
to know when the last change occured.
The timer value will be used for troubleshooting by a show
command in the next commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_labelpool.h
bgpd/bgp_mplsvpn.c

index d1a2d5f003d4fa9b97bf67a2cd2ba469a638665d..ee80aad45b565c1524f56fa50197dc56b9c21498 100644 (file)
@@ -74,6 +74,8 @@ struct bgp_label_per_nexthop_cache {
        /* list of path_vrfs using it */
        LIST_HEAD(path_lists, bgp_path_info) paths;
 
+       time_t last_update;
+
        /* Back pointer to the cache tree this entry belongs to. */
        struct bgp_label_per_nexthop_cache_head *tree;
 };
index 9e75261a5cc7d6b2275a4a6c876096a49faa5ae5..ecc84533b05c7dbb2dac26fd888df9f471bacbd4 100644 (file)
@@ -1472,6 +1472,7 @@ static mpls_label_t _vpn_leak_from_vrf_get_per_nexthop_label(
                LIST_INSERT_HEAD(&(blnc->paths), pi, label_nh_thread);
                pi->label_nexthop_cache = blnc;
                pi->label_nexthop_cache->path_count++;
+               blnc->last_update = monotime(NULL);
        }
 
        /* then add or update the selected nexthop */