+// SPDX-License-Identifier: GPL-2.0-or-later
/* BGP-4 dump routine
* Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
if (bgp_dump->filename[0] != DIRECTORY_SEP) {
snprintf(fullpath, sizeof(fullpath), "%s/%s", vty_get_cwd(),
bgp_dump->filename);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+ /* user supplied date/time format string */
ret = strftime(realpath, MAXPATHLEN, fullpath, &tm);
} else
ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, &tm);
+#pragma GCC diagnostic pop
if (ret == 0) {
- flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: strftime error");
+ flog_warn(EC_BGP_DUMP, "%s: strftime error", __func__);
return NULL;
}
bgp_dump->fp = fopen(realpath, "w");
if (bgp_dump->fp == NULL) {
- flog_warn(EC_BGP_DUMP, "bgp_dump_open_file: %s: %s", realpath,
+ flog_warn(EC_BGP_DUMP, "%s: %s: %s", __func__, realpath,
strerror(errno));
umask(oldumask);
return NULL;
stream_putw(obuf, path->peer->table_dump_index);
/* Originated */
- stream_putl(obuf, time(NULL) - (bgp_clock() - path->uptime));
+ stream_putl(obuf, time(NULL) - (monotime(NULL) - path->uptime));
/*Path Identifier*/
if (addpath_capable) {
/* Dump attribute. */
/* Skip prefix & AFI/SAFI for MP_NLRI */
- bgp_dump_routes_attr(obuf, path->attr, p);
+ bgp_dump_routes_attr(obuf, path, p);
cur_endp = stream_get_endp(obuf);
if (cur_endp > BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE
}
/* Removing interval event. */
- thread_cancel(&bgp_dump->t_interval);
+ THREAD_OFF(bgp_dump->t_interval);
bgp_dump->interval = 0;