diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-08-18 00:32:14 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-08-24 14:28:51 +0200 |
commit | 98b7e9754c5fc379da9e0f8a8fd8172fe5315bae (patch) | |
tree | 40e2c91a6b7ac7e3422b6a798db66a739caa4621 | |
parent | bgpd: Convert from bgp_clock() to monotime() (diff) | |
download | frr-98b7e9754c5fc379da9e0f8a8fd8172fe5315bae.tar.xz frr-98b7e9754c5fc379da9e0f8a8fd8172fe5315bae.zip |
bgpd: Replace rfapi_time() with monotime()
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r-- | bgpd/rfapi/rfapi.c | 5 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_import.c | 2 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_private.h | 5 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_rib.c | 16 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_vty.c | 2 |
5 files changed, 17 insertions, 13 deletions
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index d10ed0774..a34c10d84 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1351,8 +1351,7 @@ int rfapi_init_and_open(struct bgp *bgp, struct rfapi_descriptor *rfd, struct prefix pfx_un; struct agg_node *rn; - - rfapi_time(&rfd->open_time); + rfd->open_time = monotime(NULL); if (rfg->type == RFAPI_GROUP_CFG_VRF) SET_FLAG(rfd->flags, RFAPI_HD_FLAG_IS_VRF); @@ -1521,7 +1520,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target, } rfd->rsp_counter++; /* dedup: identify this generation */ - rfd->rsp_time = rfapi_time(NULL); /* response content dedup */ + rfd->rsp_time = monotime(NULL); /* response content dedup */ rfd->ftd_last_allowed_time = monotime(NULL) - bgp->rfapi_cfg->rfp_cfg.ftd_advertisement_interval; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 1d4270276..6fb509fd9 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -489,7 +489,7 @@ static struct bgp_path_info *rfapiBgpInfoCreate(struct attr *attr, bgp_path_info_extra_get(new); if (prd) { new->extra->vnc.import.rd = *prd; - rfapi_time(&new->extra->vnc.import.create_time); + new->extra->vnc.import.create_time = monotime(NULL); } if (label) encode_label(*label, &new->extra->label[0]); diff --git a/bgpd/rfapi/rfapi_private.h b/bgpd/rfapi/rfapi_private.h index bc0e192ae..8c76e1dd0 100644 --- a/bgpd/rfapi/rfapi_private.h +++ b/bgpd/rfapi/rfapi_private.h @@ -364,6 +364,11 @@ extern int rfapi_extract_l2o( * compaitibility to old quagga_time call * time_t value in terms of stabilised absolute time. * replacement for POSIX time() + * + * Please do not use this. This is kept only for + * Lou's CI in that that CI compiles against some + * private bgp code and it will just fail to compile + * without this. Use monotime() */ extern time_t rfapi_time(time_t *t); diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index ffcd36557..9e13c4813 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -784,7 +784,7 @@ int rfapiRibPreloadBi( skiplist_insert(slRibPt, &ori->rk, ori); } - ori->last_sent_time = rfapi_time(NULL); + ori->last_sent_time = monotime(NULL); /* * poke timer @@ -1089,7 +1089,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd, rfapiFreeBgpTeaOptionChain(ori->tea_options); ori->tea_options = rfapiOptionsDup(ri->tea_options); - ori->last_sent_time = rfapi_time(NULL); + ori->last_sent_time = monotime(NULL); rfapiFreeRfapiVnOptionChain(ori->vn_options); ori->vn_options = @@ -1115,7 +1115,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd, ori->lifetime = ri->lifetime; ori->tea_options = rfapiOptionsDup(ri->tea_options); - ori->last_sent_time = rfapi_time(NULL); + ori->last_sent_time = monotime(NULL); ori->vn_options = rfapiVnOptionsDup(ri->vn_options); ori->un_options = @@ -1376,7 +1376,7 @@ callback: rfapiRibStartTimer(rfd, ri, rn, 1); RFAPI_RIB_CHECK_COUNTS( 0, delete_list->count); - ri->last_sent_time = rfapi_time(NULL); + ri->last_sent_time = monotime(NULL); #if DEBUG_RIB_SL_RD { char buf_rd[RD_ADDRSTRLEN]; @@ -1400,7 +1400,7 @@ callback: rfapiRibStartTimer(rfd, ri_del, rn, 1); RFAPI_RIB_CHECK_COUNTS( 0, delete_list->count); - ri->last_sent_time = rfapi_time(NULL); + ri->last_sent_time = monotime(NULL); } } } else { @@ -1849,7 +1849,7 @@ rfapiRibPreload(struct bgp *bgp, struct rfapi_descriptor *rfd, vnc_zlog_debug_verbose("%s: loading response=%p, use_eth_resolution=%d", __func__, response, use_eth_resolution); - new_last_sent_time = rfapi_time(NULL); + new_last_sent_time = monotime(NULL); for (nhp = response; nhp; nhp = nhp_next) { @@ -2019,7 +2019,7 @@ rfapiRibPreload(struct bgp *bgp, struct rfapi_descriptor *rfd, ri->lifetime = nhp->lifetime; ri->vn_options = rfapiVnOptionsDup(nhp->vn_options); ri->rsp_counter = rfd->rsp_counter; - ri->last_sent_time = rfapi_time(NULL); + ri->last_sent_time = monotime(NULL); if (need_insert) { int rc; @@ -2275,7 +2275,7 @@ static int print_rib_sl(int (*fp)(void *, const char *, ...), struct vty *vty, rfapiFormatAge(ri->last_sent_time, str_age, BUFSIZ); #else { - time_t now = rfapi_time(NULL); + time_t now = monotime(NULL); time_t expire = ri->last_sent_time + (time_t)ri->lifetime; /* allow for delayed/async removal */ diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index c8fdadcac..a8ab61841 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -109,7 +109,7 @@ char *rfapiFormatAge(time_t age, char *buf, size_t len) { time_t now, age_adjusted; - now = rfapi_time(NULL); + now = monotime(NULL); age_adjusted = now - age; return rfapiFormatSeconds(age_adjusted, buf, len); |