Commit Graph

12511 Commits

Author SHA1 Message Date
David Lamparter
093033e7cc
Merge pull request #2892 from qlyoung/fix-log-ref-number-signedness
lib: error codes are uint32_t's
2018-08-22 21:21:40 +02:00
Quentin Young
10744c9c38 lib: error codes are uint32_t's
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-22 17:45:47 +00:00
Donald Sharp
ff7f6cd829
Merge pull request #2890 from patrasar/Fix_2847
bgpd: Fix memory leak show ip bgp json
2018-08-22 12:26:28 -04:00
root
b2a9fc6b23 bgpd: Fix memory leak show ip bgp json
Root Cause: In the function bgp_show_table(), we are creating a
json object and a json array with the same name as “json_paths”.
First it will create a json object variable "json_paths" pointing
to the memory allocated for the json object. Then it will create
a json array for each bap node rn (if rn->info is available) with
the same name as json_paths. Because of this, json_paths which was
pointing to the memory allocated for the json object earlier, now
will be overwritten with the memory allocated for the json array.
As per the existing code, at the end of each iteration loop of bgp
node, it will deallocate the memory used by the json array and
assigned NULL to the variable json_paths. Since we don’t have the
pointer pointing to the memory allocated for json object, will be
not able to de-allocate the memory, which is a memory leak here.

Fix: Removing this json object since it is never getting used in
this function.

Testing:  Reproduced the memory leak with valgrind.
With the fix, memory leak gets resolved and checked with valgrind.

Signed-off-by: Sarita Patra saritap@vmware.com
2018-08-22 16:22:17 -07:00
Donald Sharp
61929aa5f9
Merge pull request #2850 from patrasar/Fix_2363
Fix pim_mroute_del crash while killing pimd
2018-08-22 11:44:15 -04:00
Donald Sharp
1f063a699b
Merge pull request #2884 from opensourcerouting/assorted-20180821
assorted warning fixes
2018-08-22 08:17:32 -04:00
Donald Sharp
dca5ef3053
Merge pull request #2818 from kssoman/rmap_fix
Zebra does not properly track which route-maps are changed (#2493)
2018-08-22 07:50:14 -04:00
Donald Sharp
46a67d2587
Merge pull request #2888 from pguibert6WIND/misc_fix_static_tableid
Misc fix static tableid
2018-08-22 07:40:14 -04:00
Philippe Guibert
7a2c24df02 static: remove useless debug variable
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-22 10:04:49 +02:00
Philippe Guibert
31d4a8e5f0 staticd: do not forget to set table id marker on zebra message
Table identifier is not read if table id marker is not set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-22 10:04:06 +02:00
Philippe Guibert
f69f6f56f5 staticd: remove usage of vrf_is_backend_netns in staticd
this function had to be used only inside zebra ( this was written in the
header vrf.h). To keep the functionality, a more generic API is used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-22 10:03:16 +02:00
Philippe Guibert
3d4c0b49da lib: change vrf_is_mapped_on_netns API
The function handles not a vrf pointer instead of a vrf_id value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-22 09:19:04 +02:00
root
e83f3b316a pimd: Fix pim_mroute_del crash while terminating pimd
When pimd is getting terminated, pim_upstream_del() gets called as
part of cleaning process. pim_upstream_del() deletes the route and
assigns NULL to the up->channel_oil. It also deletes each if_channel
by calling the function pim_ifchannel_delete().
pim_ifchannel_delete() internally calls the caller function pim_upstream_del(),
if it is the last ifchannel for that upstream. So pim_upstream_del
is getting called twice, which will access the up->channel_oil which
was already set to NULL before. This results in crash.

Fix:
pim_ifchannel_delete() should call pim_upstream_del (caller function)
only if the up->ref_count > 0. Added an assert(up->ref_count > 0) in
the function pim_upstream_del().

Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-08-22 00:00:32 -07:00
David Lamparter
0e70e6c89d lib/bgpd: re-fix bgp_info_extra_free()
Make the wart slightly less bad... also there is still a possible write
after free here.  This needs to be fixed again, properly, by some
structure changes.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-22 06:32:43 +02:00
Donald Sharp
463e781705
Merge pull request #2868 from opensourcerouting/snap-rpki
snapcraft: Add RPKI to snap package
2018-08-21 18:49:24 -04:00
Donald Sharp
962709b8d2
Merge pull request #2877 from pguibert6WIND/fixup_fs_master
bgpd: avoid memory leak in bgp flowspec list, plus usage of bool
2018-08-21 18:46:42 -04:00
David Lamparter
9e32cce03f
Merge pull request #2876 from donaldsharp/lsa_new_and_data
ospfd: Add ospf_lsa_new_and_data function and abstract away
2018-08-21 21:22:45 +02:00
David Lamparter
f4c28c4486
Merge pull request #2882 from qlyoung/fix-zlog-deadlock
lib: fix deadlock in log.c
2018-08-21 21:21:28 +02:00
David Lamparter
a2dc7057e0 *: fix gcc-8 format-overflow warnings
e.g.
pimd/pim_oil.c: In function ‘pim_channel_oil_dump’:
pimd/pim_oil.c:51:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]

Build on gcc-8.2.0 is warning-free after this patch.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-21 21:05:09 +02:00
David Lamparter
bd27ea43e9 build: wrap "fallthrough" attr
This generates a warning on gcc versions before 7.0.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-21 20:34:58 +02:00
Philippe Guibert
45837bc40d bgpd: pbr entry log message changed to zlog_debug
pbr entry log message changed to zlog_debug.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-21 18:30:32 +02:00
Philippe Guibert
5a430eee9a bgpd: simplify fs add pbr entry
Simplify the fs pbr entry creation.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-21 18:30:32 +02:00
Philippe Guibert
503d1ec6eb bgpd: avoid memory leak in bgp flowspec list, plus usage of bool
Avoid memory leak in bgp flowspec list.
Usage of bool parameter instead of int, to handle the number of entries
PBR.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-21 18:30:26 +02:00
Quentin Young
dce2036b6a lib: fix deadlock in log.c
Daemons could deadlock when log file could not be opened during a log
rotation.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-21 15:15:38 +00:00
David Lamparter
5ab5e410d0
Merge pull request #2881 from donaldsharp/external_removal
ospfd: Remove unused function
2018-08-21 17:00:28 +02:00
Donald Sharp
8732a8edd7
Merge pull request #2878 from pguibert6WIND/fix_show_error_all
lib: fix show error all
2018-08-21 10:35:16 -04:00
Donald Sharp
19c0412aad ospfd: Remove unused function
The ospf_external_route_lookup function was not
being used so let's just remove it.

Unfortunately the removal was not quite so simple as
that ospf_asbr.h was being used to generate a reference
for the `struct ospf_route` data structure, so we
need to fix up the compile by fixing up header
inclusions so that ospf_route.h is actually included

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-21 08:40:51 -04:00
Philippe Guibert
b2111f08a5 lib: fix show error all
show error all was displaying 0 value for code, whereas real code value
was not displayed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-21 11:10:40 +02:00
David Lamparter
f8a523363e
Merge pull request #2867 from dslicenc/show-route-leak-json
bgpd: add json output to bgp route-leak show command
2018-08-21 05:52:30 +02:00
Donald Sharp
5b3d4186de ospfd: Add ospf_lsa_new_and_data function and abstract away
In all but one instance we were following this pattern
with ospf_lsa_new:

ospf_lsa_new()
ospf_lsa_data_new()

so let's create a ospf_lsa_new_and_data to abstract
this bit of fun and cleanup all the places where
it assumes these function calls can fail.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-20 20:41:37 -04:00
Donald Sharp
164ab8625e
Merge pull request #2874 from opensourcerouting/fix-doc-bfdd-index
doc: address multiple warnings related to bfdd's docs
2018-08-20 19:39:27 -04:00
Rafael Zalamena
e36ff3f3a8 bfdd: fix documentation warnings
* Extend dashes on 'OSPF BFD Configuration' title;
* Add JSON output code indentation;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-20 23:22:16 +02:00
Don Slice
6ce24e5247 bgpd: fix additional issue with bgp route-leak json commit
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-20 21:05:57 +00:00
Christian Franke
3b12dd8204 doc: bfdd manpage should be included in the manpage index
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-20 22:44:56 +02:00
Don Slice
04c9077f81 bgpd: fix issues with bgp route-leak json commit
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-20 19:36:11 +00:00
David Lamparter
919925782c
Merge pull request #2872 from donaldsharp/tcp_zebra
doc, debianpkg: Cleanup tcp-zebra configure options
2018-08-20 20:53:26 +02:00
Donald Sharp
1491ad1ec4 doc, debianpkg: Cleanup tcp-zebra configure options
Since we removed --enable-tcp-zebra cleanup the last
remaining vestiges of that code from the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-20 13:17:34 -04:00
David Lamparter
a55a8b4538
Merge pull request #2814 from qlyoung/fix-ospf6d-lsa-uaf-test
ospf6d: fix use after free on LSA
2018-08-20 18:16:46 +02:00
Martin Winter
4ed8f3f619 snapcraft: Add RPKI to snap package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-08-18 13:33:01 -07:00
Don Slice
b46dfd2022 bgpd: add json output to bgp route-leak show command
Ticket: CM-20259
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-18 11:43:08 +00:00
kssoman
01ba450582 zebra : routemap "match ipv6 address prefix list" does not work
* Added code for "match ipv6 address prefix list" command
* Added common function route_match_address_prefix_list() to process
  routemap for AFI_IP and AFI_IP6 address family

Signed-off-by: kssoman <somanks@vmware.com>
2018-08-17 08:53:28 -07:00
Lou Berger
e0909ff51f
Merge pull request #2829 from donaldsharp/more_upstream
bgpd: Check for L3VNI before sending RMAC/L3 RTs
2018-08-17 11:49:44 -04:00
kssoman
d5b8c21628 zebra : Zebra does not properly track which route-maps are changed (#2493)
* Check for the modified routemap in zebra_route_map_process_update_cb()
* Added zebra_rib_table_rm_update() for RIB routemap processing
* Added zebra_nht_rm_update() for NHT routemap processing

Signed-off-by: kssoman <somanks@vmware.com>
2018-08-17 08:47:48 -07:00
Russ White
5719a7b88d
Merge pull request #2834 from dslicenc/import-vrf-fixes
bgpd: issues with vrf imports when switchd or networking restarted
2018-08-17 09:16:26 -04:00
Quentin Young
ea454ba398
Merge pull request #2858 from Jafaral/sphinx
configure.ac: emit a config  warning if sphinx-build is missing
2018-08-16 23:45:14 -04:00
Donald Sharp
018928cbaa
Merge pull request #2856 from opensourcerouting/bfd-work
bfdd: bug fixes and improvements
2018-08-16 18:48:51 -04:00
Rafael Zalamena
ad03f5ec8a
Merge pull request #2857 from donaldsharp/ptm_loves_us
zebra: When using BFD ensure that zebra thinks ptm is disabled
2018-08-16 18:34:59 -03:00
Rafael Zalamena
3bcd76c4af bfdd: fix coverity scan issue (CID 1472622)
Don't use the stack variable, but what we have recorded in our buffered
data on the heap.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-16 18:33:32 -03:00
Rafael Zalamena
7efe273ae4 bfdd: fix zebra_ptm adapter memory leak
Memory leak detect with Address Sanitizer and topotests.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-16 18:33:32 -03:00
Rafael Zalamena
ae9f45a3ae bfdd: improve ptm_adapter log messages
Make them look like the rest of the daemon: message begins with a unique
descriptive message to help locate debug messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-16 18:33:32 -03:00