19451112 Memory leaks in Quagga OSPF daemon
authorBrian Utterback <brian.utterback@oracle.com>
Mon, 09 Nov 2015 17:42:03 -0800
changeset 5170 970e0f411b42
parent 5169 c5d3147d411a
child 5171 4e8b3c0ea78c
19451112 Memory leaks in Quagga OSPF daemon 22177066 Quagga man page patch is obsolete after PSARC 2015/428
components/quagga/patches/30-ospf-memleak.patch
components/quagga/patches/90-fix-manpages
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/quagga/patches/30-ospf-memleak.patch	Mon Nov 09 17:42:03 2015 -0800
@@ -0,0 +1,42 @@
+This was reported to the Quagga community as bug 813.
+https://bugzilla.quagga.net/show_bug.cgi?id=813
+The patch has been submitted and attached to that bug.
+This patch may be removed if the version of Quagga is updated to a version
+that has this bug fixed.
+--- ospfd/ospf_apiserver.c
++++ ospfd/ospf_apiserver.c
[email protected]@ -375,6 +375,11 @@ ospf_apiserver_free (struct ospf_apiserv
+ 
+     }
+ 
++  if (apiserv->opaque_types)
++    {
++      list_delete (apiserv->opaque_types);
++    }
++
+   /* Close connections to OSPFd. */
+   if (apiserv->fd_sync > 0)
+     {
[email protected]@ -978,10 +978,11 @@ ospf_apiserver_unregister_opaque_type (s
+ 	  ospf_apiserver_flush_opaque_lsa (apiserv, lsa_type, opaque_type);
+ 	  ospf_delete_opaque_functab (lsa_type, opaque_type);
+ 
+ 	  /* Remove from list of registered opaque types */
+ 	  listnode_delete (apiserv->opaque_types, regtype);
++	  XFREE(MTYPE_OSPF_APISERVER, regtype);
+ 
+           if (IS_DEBUG_OSPF_EVENT)
+             zlog_debug ("API: Del LSA-type(%d)/Opaque-type(%d)"
+                        " from apiserv(%p), total#(%d)", 
+                        lsa_type, opaque_type, apiserv, 
+--- ospfd/ospfd.c
++++ ospfd/ospfd.c
[email protected]@ -633,7 +633,7 @@ ospf_area_free (struct ospf_area *area)
+   /* Cancel timer. */
+   OSPF_TIMER_OFF (area->t_stub_router);
+ #ifdef HAVE_OPAQUE_LSA
+-  OSPF_TIMER_OFF (area->t_opaque_lsa_self);
++  ospf_opaque_type10_lsa_term (area);
+ #endif /* HAVE_OPAQUE_LSA */
+   
+   if (OSPF_IS_AREA_BACKBONE (area))
--- a/components/quagga/patches/90-fix-manpages	Tue Dec 08 09:52:14 2015 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
---- doc/bgpd.8.orig	Sat Jul  2 05:40:07 2011
-+++ doc/bgpd.8	Sat Jul  2 06:19:53 2011
[email protected]@ -1,4 +1,4 @@
--.TH BGPD 8 "25 November 2004" "Quagga BGPD daemon" "Version 0.97.3"
-+.TH BGPD 1M "25 November 2004" "Quagga BGPD daemon" "Version 0.97.3"
- .SH NAME
- bgpd \- a BGPv4, BGPv4\+, BGPv4\- routing engine for use with Quagga routing
- software
[email protected]@ -101,12 +101,12 @@
- file, or through syslog to the system logs. \fBbgpd\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR ripd (8),
--.BR ripngd (8),
--.BR ospfd (8),
--.BR ospf6d (8),
--.BR isisd (8),
--.BR zebra (8),
-+.BR ripd (1m),
-+.BR ripngd (1m),
-+.BR ospfd (1m),
-+.BR ospf6d (1m),
-+.BR isisd (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- .B bgpd
---- doc/isisd.8.orig	Sat Jul  2 05:40:17 2011
-+++ doc/isisd.8	Sat Jul  2 06:20:18 2011
[email protected]@ -1,4 +1,4 @@
--.TH IS-IS 8 "25 November 2004" "Quagga IS-IS daemon" "Version 0.97.3"
-+.TH IS-IS 1M "25 November 2004" "Quagga IS-IS daemon" "Version 0.97.3"
- .SH NAME
- isisd \- an IS-IS routing engine for use with Quagga routing software.
- .SH SYNOPSIS
[email protected]@ -90,12 +90,12 @@
- file, or through syslog to the system logs. \fBisisd\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripd (8),
--.BR ripngd (8),
--.BR ospfd (8),
--.BR ospf6d (8),
--.BR zebra (8),
-+.BR bgpd (1m),
-+.BR ripd (1m),
-+.BR ripngd (1m),
-+.BR ospfd (1m),
-+.BR ospf6d (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- \fBisisd\fR is ALPHA quality at the moment and hasn't any way ready for
---- doc/ospf6d.8.orig	Sat Jul  2 05:40:26 2011
-+++ doc/ospf6d.8	Sat Jul  2 06:20:43 2011
[email protected]@ -1,4 +1,4 @@
--.TH OSPF6D 8 "25 November 2004" "Quagga OSPFv3 daemon" "Version 0.97.3"
-+.TH OSPF6D 1M "25 November 2004" "Quagga OSPFv3 daemon" "Version 0.97.3"
- .SH NAME
- ospf6d \- an OSPFv3 routing engine for use with Quagga routing software.
- .SH SYNOPSIS
[email protected]@ -91,12 +91,12 @@
- file, or through syslog to the system logs. \fBospf6d\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripd (8),
--.BR ripngd (8),
--.BR ospfd (8),
--.BR isisd (8),
--.BR zebra (8),
-+.BR bgpd (1m),
-+.BR ripd (1m),
-+.BR ripngd (1m),
-+.BR ospfd (1m),
-+.BR isisd (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- .B ospf6d
---- doc/ospfd.8.orig	Sat Jul  2 05:40:33 2011
-+++ doc/ospfd.8	Sat Jul  2 06:21:02 2011
[email protected]@ -1,4 +1,4 @@
--.TH OSPFD 8 "25 November 2004" "Quagga OSPFv2 daemon" "Version 0.97.3"
-+.TH OSPFD 1M "25 November 2004" "Quagga OSPFv2 daemon" "Version 0.97.3"
- .SH NAME
- ospfd \- an OSPFv2 routing engine for use with Quagga routing software.
- .SH SYNOPSIS
[email protected]@ -96,12 +96,12 @@
- file, or through syslog to the system logs. \fBospfd\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripd (8),
--.BR ripngd (8),
--.BR ospf6d (8),
--.BR isisd (8),
--.BR zebra (8),
-+.BR bgpd (1m),
-+.BR ripd (1m),
-+.BR ripngd (1m),
-+.BR ospf6d (1m),
-+.BR isisd (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- .B ospfd
---- doc/ripd.8.orig	Sat Jul  2 05:40:40 2011
-+++ doc/ripd.8	Sat Jul  2 06:21:39 2011
[email protected]@ -1,4 +1,4 @@
--.TH RIPD 8 "25 November 2004" "Quagga RIP daemon" "Version 0.97.3"
-+.TH RIPD 1M "25 November 2004" "Quagga RIP daemon" "Version 0.97.3"
- .SH NAME
- ripd \- a RIP routing engine for use with Quagga routing software.
- .SH SYNOPSIS
[email protected]@ -94,12 +94,12 @@
- file, or through syslog to the system logs. \fBripd\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripngd (8),
--.BR ospfd (8),
--.BR ospf6d (8),
--.BR isisd (8),
--.BR zebra (8),
-+.BR bgpd (1m),
-+.BR ripngd (1m),
-+.BR ospfd (1m),
-+.BR ospf6d (1m),
-+.BR isisd (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- .B ripd
---- doc/ripngd.8.orig	Sat Jul  2 05:40:49 2011
-+++ doc/ripngd.8	Sat Jul  2 06:21:59 2011
[email protected]@ -1,4 +1,4 @@
--.TH RIPNGD 8 "25 November 2004" "Quagga RIPNG daemon" "Version 0.97.3"
-+.TH RIPNGD 1M "25 November 2004" "Quagga RIPNG daemon" "Version 0.97.3"
- .SH NAME
- ripngd \- a RIPNG routing engine for use with Quagga routing software.
- .SH SYNOPSIS
[email protected]@ -97,12 +97,12 @@
- file, or through syslog to the system logs. \fBripngd\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripd (8),
--.BR ospfd (8),
--.BR ospf6d (8),
--.BR isisd (8),
--.BR zebra (8),
-+.BR bgpd (1m),
-+.BR ripd (1m),
-+.BR ospfd (1m),
-+.BR ospf6d (1m),
-+.BR isisd (1m),
-+.BR zebra (1m),
- .BR vtysh (1)
- .SH BUGS
- .B ripngd
---- doc/zebra.8.orig	Sat Jul  2 05:40:55 2011
-+++ doc/zebra.8	Sat Jul  2 06:22:13 2011
[email protected]@ -1,4 +1,4 @@
--.TH ZEBRA 8 "25 November 2004" "Zebra daemon" "Version 0.97.3"
-+.TH ZEBRA 1M "25 November 2004" "Zebra daemon" "Version 0.97.3"
- .SH NAME
- zebra \- a routing manager for use with associated Quagga components.
- .SH SYNOPSIS
[email protected]@ -116,12 +116,12 @@
- file, or through syslog to the system logs. \fBzebra\fR supports many
- debugging options, see the Info file, or the source for details.
- .SH "SEE ALSO"
--.BR bgpd (8),
--.BR ripd (8),
--.BR ripngd (8),
--.BR ospfd (8),
--.BR ospf6d (8),
--.BR isisd (8),
-+.BR bgpd (1m),
-+.BR ripd (1m),
-+.BR ripngd (1m),
-+.BR ospfd (1m),
-+.BR ospf6d (1m),
-+.BR isisd (1m),
- .BR vtysh (1)
- .SH BUGS
- .B zebra