]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Replace rfapi_time() with monotime()
authorDonald Sharp <sharpd@nvidia.com>
Wed, 17 Aug 2022 22:32:14 +0000 (18:32 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 24 Aug 2022 12:28:51 +0000 (08:28 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_private.h
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/rfapi_vty.c

index d10ed0774d9eb62b9925155ffb8ebea92590b0b2..a34c10d84280c80ff733b6eacae9ce932a0e4611 100644 (file)
@@ -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;
index 1d427027696c87511faa92c0a6f3e8f6a1ea723f..6fb509fd9c893460fec76e8e70956a525fe4ff13 100644 (file)
@@ -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]);
index bc0e192ae2d59a92d02058fa40270a6bb9946d27..8c76e1dd0bec85ed34e5d452c5fe1d0d297dbfb3 100644 (file)
@@ -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);
 
index ffcd36557991290f7d7ca05bcbda2e9c9f3cbaa4..9e13c481340c3163ee0071044aea3b4ef57153dd 100644 (file)
@@ -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 */
index c8fdadcac9583e2daeb1bf9bda22d664a126fadb..a8ab618417e68161198c9c716baa498ef52d0131 100644 (file)
@@ -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);