From 3784736b09e0a1e23d9c6a4064a97386bcb6abb2 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 20 Dec 2024 17:23:14 +0200 Subject: [PATCH] bgpd: Drop timestamp_string() Replace with time_to_string(). Signed-off-by: Donatas Abraitis --- bgpd/bgp_updgrp.c | 6 ++---- bgpd/bgpd.h | 8 -------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index 4d05187616..35ddfc34ff 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -766,8 +766,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg) safi2str(updgrp->safi)); } else { vty_out(vty, "Update-group %" PRIu64 ":\n", updgrp->id); - vty_out(vty, " Created: %s", - timestamp_string(updgrp->uptime, timebuf)); + vty_out(vty, " Created: %s", time_to_string(updgrp->uptime, timebuf)); } filter = &updgrp->conf->filter[updgrp->afi][updgrp->safi]; @@ -842,8 +841,7 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg) vty_out(vty, "\n"); vty_out(vty, " Update-subgroup %" PRIu64 ":\n", subgrp->id); - vty_out(vty, " Created: %s", - timestamp_string(subgrp->uptime, timebuf)); + vty_out(vty, " Created: %s", time_to_string(subgrp->uptime, timebuf)); } if (subgrp->split_from.update_group_id diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index dbab2bcf88..fcb26051a2 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -2711,14 +2711,6 @@ static inline int peer_group_af_configured(struct peer_group *group) return 0; } -static inline char *timestamp_string(time_t ts, char *timebuf) -{ - time_t tbuf; - - tbuf = time(NULL) - (monotime(NULL) - ts); - return ctime_r(&tbuf, timebuf); -} - static inline bool peer_established(struct peer_connection *connection) { return connection->status == Established;