From: Philippe Guibert Date: Thu, 16 Feb 2023 12:46:32 +0000 (+0100) Subject: bgpd: update time of last change when label nexthop entry changed X-Git-Tag: base_9.0~73^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=60e5bc23b9fabeb2d7e163333be02ccc396e54c1;p=matthieu%2Ffrr.git bgpd: update time of last change when label nexthop entry changed 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 --- diff --git a/bgpd/bgp_labelpool.h b/bgpd/bgp_labelpool.h index d1a2d5f003..ee80aad45b 100644 --- a/bgpd/bgp_labelpool.h +++ b/bgpd/bgp_labelpool.h @@ -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; }; diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 9e75261a5c..ecc84533b0 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -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 */