summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-02-01 10:52:21 -0500
committerGitHub <noreply@github.com>2017-02-01 10:52:21 -0500
commit5a2bd83d9de7bdd528b4be78f337f9c7a196c70b (patch)
tree477672d8900b8fcba04bd36f7b5122242d9ac876
parent681ca8cc528a1aec1e451b9ae860d3825f999052 (diff)
parentd24736fa17f9970dd58c5e6417bf3a5444011f5e (diff)
Merge pull request #146 from opensourcerouting/assorted-stable
assorted fixes for stable/2.0
-rw-r--r--bgpd/bgp_dump.c12
-rw-r--r--bgpd/bgp_main.c3
-rw-r--r--isisd/isis_main.c2
-rw-r--r--ldpd/ldpd.c2
-rw-r--r--lib/plist.c4
-rw-r--r--lib/sockopt.c4
-rw-r--r--lib/sockopt.h3
-rw-r--r--ospf6d/ospf6_main.c2
-rw-r--r--ospfd/ospf_main.c2
-rw-r--r--pimd/pim_main.c2
-rw-r--r--ripd/rip_main.c2
-rw-r--r--ripngd/ripng_main.c2
-rw-r--r--vtysh/vtysh_main.c2
-rw-r--r--zebra/main.c2
-rw-r--r--zebra/zebra_fpm_dt.c2
-rw-r--r--zebra/zebra_vrf.c7
16 files changed, 35 insertions, 18 deletions
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index 7a4d4e701f..a8c9dad843 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -91,7 +91,7 @@ struct bgp_dump
struct thread *t_interval;
};
-static int bgp_dump_unset (struct vty *vty, struct bgp_dump *bgp_dump);
+static int bgp_dump_unset (struct bgp_dump *bgp_dump);
static int bgp_dump_interval_func (struct thread *);
/* BGP packet dump output buffer. */
@@ -661,7 +661,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
}
/* Removing previous config */
- bgp_dump_unset(vty, bgp_dump);
+ bgp_dump_unset(bgp_dump);
if (interval_str)
{
@@ -700,7 +700,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump,
}
static int
-bgp_dump_unset (struct vty *vty, struct bgp_dump *bgp_dump)
+bgp_dump_unset (struct bgp_dump *bgp_dump)
{
/* Removing file name. */
if (bgp_dump->filename)
@@ -815,7 +815,7 @@ DEFUN (no_dump_bgp_all,
break;
}
- return bgp_dump_unset (vty, bgp_dump_struct);
+ return bgp_dump_unset (bgp_dump_struct);
}
/* BGP node structure. */
@@ -913,6 +913,10 @@ bgp_dump_init (void)
void
bgp_dump_finish (void)
{
+ bgp_dump_unset (&bgp_dump_all);
+ bgp_dump_unset (&bgp_dump_updates);
+ bgp_dump_unset (&bgp_dump_routes);
+
stream_free (bgp_dump_obuf);
bgp_dump_obuf = NULL;
}
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index e6f5cdcb67..979471dc49 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -40,6 +40,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "queue.h"
#include "vrf.h"
#include "bfd.h"
+#include "sockopt.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h"
@@ -309,6 +310,8 @@ bgp_exit (int status)
if (zlog_default)
closezlog (zlog_default);
+ memset (bm, 0, sizeof (*bm));
+
if (bgp_debug_count())
log_memstats_stderr ("bgpd");
exit (status);
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index 865f5c5f94..1b9fa68051 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -38,6 +38,7 @@
#include "plist.h"
#include "zclient.h"
#include "vrf.h"
+#include "sockopt.h"
#include "qobj.h"
#include "isisd/dict.h"
@@ -246,7 +247,6 @@ main (int argc, char **argv, char **envp)
struct thread thread;
char *config_file = NULL;
char *vty_addr = NULL;
- char *vty_sock_name;
int dryrun = 0;
/* Get the programname without the preceding path. */
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 40726ba0bb..927af682a1 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -39,6 +39,7 @@
#include "sigevent.h"
#include "zclient.h"
#include "vrf.h"
+#include "sockopt.h"
#include "qobj.h"
static void ldpd_shutdown(void);
@@ -224,7 +225,6 @@ main(int argc, char *argv[])
char *p;
char *vty_addr = NULL;
int vty_port = LDP_VTY_PORT;
- char *vty_sock_name;
char *ctl_sock_custom_path = NULL;
char *ctl_sock_name;
int daemon_mode = 0;
diff --git a/lib/plist.c b/lib/plist.c
index 2b93d880f6..6f19565688 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -328,6 +328,9 @@ prefix_list_get (afi_t afi, int orf, const char *name)
return plist;
}
+static void prefix_list_trie_del (struct prefix_list *plist,
+ struct prefix_list_entry *pentry);
+
/* Delete prefix-list from prefix_list_master and free it. */
static void
prefix_list_delete (struct prefix_list *plist)
@@ -341,6 +344,7 @@ prefix_list_delete (struct prefix_list *plist)
for (pentry = plist->head; pentry; pentry = next)
{
next = pentry->next;
+ prefix_list_trie_del (plist, pentry);
prefix_list_entry_free (pentry);
plist->count--;
}
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 570b575a7a..e661b4cc56 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -31,9 +31,9 @@
/* Replace the path of given defaultpath with newpath, but keep filename */
void
-set_socket_path (char *path, char *defaultpath, char *newpath, int maxsize)
+set_socket_path (char *path, const char *defaultpath, char *newpath, int maxsize)
{
- char *sock_name;
+ const char *sock_name;
sock_name = strrchr(defaultpath, '/');
if (sock_name)
diff --git a/lib/sockopt.h b/lib/sockopt.h
index 8e7895dd6f..7e1bd62446 100644
--- a/lib/sockopt.h
+++ b/lib/sockopt.h
@@ -25,7 +25,8 @@
#include "sockunion.h"
/* Override (vty) socket paths, but keep the filename */
-extern void set_socket_path (char *path, char *defaultpath, char *newpath, int maxsize);
+extern void set_socket_path (char *path, const char *defaultpath,
+ char *newpath, int maxsize);
extern void setsockopt_so_recvbuf (int sock, int size);
extern void setsockopt_so_sendbuf (const int sock, int size);
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 68d2b6894d..f85580fa59 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -39,6 +39,7 @@
#include "zclient.h"
#include "vrf.h"
#include "bfd.h"
+#include "sockopt.h"
#include "ospf6d.h"
#include "ospf6_top.h"
@@ -239,7 +240,6 @@ main (int argc, char *argv[], char *envp[])
int opt;
char *vty_addr = NULL;
int vty_port = 0;
- char *vty_sock_name;
char *config_file = NULL;
struct thread thread;
int dryrun = 0;
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 6719eb2497..845d96032b 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -41,6 +41,7 @@
#include "sigevent.h"
#include "zclient.h"
#include "vrf.h"
+#include "sockopt.h"
#include "ospfd/ospfd.h"
#include "ospfd/ospf_interface.h"
@@ -194,7 +195,6 @@ main (int argc, char **argv)
char *vty_addr = NULL;
int vty_port = OSPF_VTY_PORT;
char vty_path[100];
- char *vty_sock_name;
int daemon_mode = 0;
char *config_file = NULL;
char *progname;
diff --git a/pimd/pim_main.c b/pimd/pim_main.c
index 1a3c8165e4..e4aa2de594 100644
--- a/pimd/pim_main.c
+++ b/pimd/pim_main.c
@@ -38,6 +38,7 @@
#include "prefix.h"
#include "plist.h"
#include "vrf.h"
+#include "sockopt.h"
#include "pimd.h"
#include "pim_version.h"
@@ -133,7 +134,6 @@ Report bugs to %s\n", progname, PIMD_BUG_ADDRESS);
int main(int argc, char** argv, char** envp) {
char *p;
char *vty_addr = NULL;
- char *vty_sock_name;
int vty_port = -1;
int daemon_mode = 0;
char *config_file = NULL;
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index e46f867952..58dd2df6fa 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -35,6 +35,7 @@
#include "sigevent.h"
#include "zclient.h"
#include "vrf.h"
+#include "sockopt.h"
#include "ripd/ripd.h"
@@ -201,7 +202,6 @@ main (int argc, char **argv)
int dryrun = 0;
char *progname;
struct thread thread;
- char *vty_sock_name;
/* Set umask before anything for security */
umask (0027);
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 1677996eaa..a90dffce14 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -36,6 +36,7 @@
#include "privs.h"
#include "sigevent.h"
#include "vrf.h"
+#include "sockopt.h"
#include "ripngd/ripngd.h"
@@ -201,7 +202,6 @@ main (int argc, char **argv)
char *progname;
struct thread thread;
int dryrun = 0;
- char *vty_sock_name;
/* Set umask before anything for security */
umask (0027);
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index bad21ae661..78b17be058 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -272,7 +272,7 @@ main (int argc, char **argv, char **env)
int boot_flag = 0;
const char *daemon_name = NULL;
const char *inputfile = NULL;
- char *vtysh_configfile_name;
+ const char *vtysh_configfile_name;
struct cmd_rec {
const char *line;
struct cmd_rec *next;
diff --git a/zebra/main.c b/zebra/main.c
index aa1cbc3b26..a68e8adeb6 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -35,6 +35,7 @@
#include "privs.h"
#include "sigevent.h"
#include "vrf.h"
+#include "sockopt.h"
#include "zebra/rib.h"
#include "zebra/zserv.h"
@@ -265,7 +266,6 @@ main (int argc, char **argv)
char *p;
char *vty_addr = NULL;
int vty_port = ZEBRA_VTY_PORT;
- char *vty_sock_name;
int dryrun = 0;
int batch_mode = 0;
int daemon_mode = 0;
diff --git a/zebra/zebra_fpm_dt.c b/zebra/zebra_fpm_dt.c
index bd171c89b2..715e250a66 100644
--- a/zebra/zebra_fpm_dt.c
+++ b/zebra/zebra_fpm_dt.c
@@ -42,6 +42,8 @@
#include "vrf.h"
#include "zebra/rib.h"
+#include "zebra/zserv.h"
+#include "zebra/zebra_vrf.h"
#include "zebra_fpm_private.h"
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index b1c5e4dd35..4715f6e12c 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -217,6 +217,7 @@ zebra_vrf_delete (struct vrf *vrf)
{
struct zebra_vrf *zvrf = vrf->info;
struct route_table *table;
+ rib_table_info_t *info;
u_int32_t table_id;
afi_t afi;
safi_t safi;
@@ -273,8 +274,9 @@ zebra_vrf_delete (struct vrf *vrf)
for (safi = SAFI_UNICAST; safi <= SAFI_MULTICAST; safi++)
{
table = zvrf->table[afi][safi];
- XFREE (MTYPE_RIB_TABLE_INFO, table->info);
+ info = table->info;
route_table_finish (table);
+ XFREE (MTYPE_RIB_TABLE_INFO, info);
table = zvrf->stable[afi][safi];
route_table_finish (table);
@@ -284,8 +286,9 @@ zebra_vrf_delete (struct vrf *vrf)
if (zvrf->other_table[afi][table_id])
{
table = zvrf->other_table[afi][table_id];
- XFREE (MTYPE_RIB_TABLE_INFO, table->info);
+ info = table->info;
route_table_finish (table);
+ XFREE (MTYPE_RIB_TABLE_INFO, info);
}
route_table_finish (zvrf->rnh_table[afi]);