From 60e5bc23b9fabeb2d7e163333be02ccc396e54c1 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 16 Feb 2023 13:46:32 +0100 Subject: [PATCH] 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 --- bgpd/bgp_labelpool.h | 2 ++ bgpd/bgp_mplsvpn.c | 1 + 2 files changed, 3 insertions(+) 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 */