Commit Graph

13855 Commits

Author SHA1 Message Date
Donald Sharp
8b52179d2a lib: Add some documentation
Add some documentation to hash_walk/iterate to tell people
to not do something stupid.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-06 10:18:50 -04:00
Donald Sharp
df66eb2eeb Revert "lib: A small optimization for the hash iterate and walk functions"
This reverts commit fc61644e440c875eefa222ab34d726c6281ca806.
2018-07-06 10:18:11 -04:00
Philippe Guibert
0faeba264e lib: add the pathname to get the realpath in case of failure
Sometimes, the file under /var/run/netns may not be authorised to be
read ( because it is not read permission for frr user, for instance).
so it is good to know what happened.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-06 08:51:54 +02:00
F. Aragon
2e1cc43679
eigrpd lib pimd zebra: dead code (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-06 01:10:15 +02:00
F. Aragon
09ed14e887
pimd: standard library usage (PVS-Studio)
fread() function was not used properly.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-06 01:09:00 +02:00
F. Aragon
2ffc213bf8
ospfd pimd: null check (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-06 00:49:24 +02:00
Quentin Young
32ec4bc474
Merge pull request #2602 from pacovn/PVS-Studio_element_overflow
bgpd zebra: element overflow (PVS-Studio)
2018-07-05 17:49:49 -04:00
Quentin Young
b1b5a009c6
Merge pull request #2623 from pacovn/PVS-Studio_memcpy_source_underflow
ldpd: buffer underflow, thread safety (PVS-Studio)
2018-07-05 17:41:25 -04:00
Quentin Young
dad87073aa
Merge pull request #2568 from pguibert6WIND/doc_mpls
doc: add MPLS configuration commands
2018-07-05 14:56:34 -04:00
Marcel Röthke
a98b00ee3e bgpd: add test for bgp_table_range_lookup
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2018-07-05 16:06:37 +02:00
Marcel Röthke
1dacdd8b25 bgpd: add support for rpki revalidation on rpki updates
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2018-07-05 16:06:37 +02:00
Jafar Al-Gharaibeh
262c829d7e
Merge pull request #2624 from donaldsharp/PIM_ZOMILY_ZOM
pimd: Use generated interface name
2018-07-04 18:42:51 -05:00
Arthur Jones
8328420909 unit tests: support code coverage instrumentation and reports
Currently, make check runs the unit tests and reports pass/fail,
but we have no way to guage how much of the code is covered by
these tests.  gcov provides those statistics on a per source
file basis, but requires special CFLAGS and LDFLAGS.  Here, we
add the --enable-gcov configure option to setup those options
correctly.  We also add a make target called check-coverage,
which runs the unit tests, runs gcov and uploads the data to
the codecov.io cloud service for display.

Finally, we include a Dockerfile-coverage which creates a
container image in alpine linux to run the tests.  To create
the image:

$ docker build \
	--build-arg commit=`git rev-parse HEAD` \
	--build-arg token=<upload token from codecov.io> \
	-t frr-gcov:latest \
	-f docker/alpine/Dockerfile-coverage .

and to create and upload the report:

$ docker run -it --rm frr-gcov:latest

Testing done:

Created and uploaded a report from my fork using alpine linux 3.7.
Non-coverage alpine 3.7 build still works.

Issue: https://github.com/FRRouting/frr/issues/2442
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-07-04 11:06:11 -07:00
Philippe Guibert
b03d34322d doc: add MPLS configuration commands
Add MPLS information to statically handle label from zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-04 19:11:20 +02:00
Donald Sharp
db20e34f09 pimd: Use generated interface name
When we have a generated interface name, use it instead of the actual
pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-03 21:31:11 -04:00
Donald Sharp
732c8da348
Merge pull request #2614 from rtrlib/2018-07-02-master-bugfix
bgpd: fix rpki validation for ipv6 (master)
2018-07-03 20:32:30 -04:00
F. Aragon
4149ef7c0f
ldpd: buffer underflow, thread safety (PVS-Studio)
This commit fixes two issues:
- memcpy() using containers of different sizes when using addr2sa(), mixing
  'struct sockaddr_storage' and 'union sockunion'.
- addr2sa() function not being thread safe (using a local static variable as
  container.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-04 00:01:22 +02:00
Quentin Young
4adc8f6852
Merge pull request #2620 from pacovn/PVS-Studio_null_check_2
bgpd lib ospfd pimd ripngd: null chk (PVS-Studio)
2018-07-03 17:38:09 -04:00
Jafar Al-Gharaibeh
94adf8d33e
Merge pull request #2610 from qlyoung/fix-zebra-pthread-crash-shutdown-min
zebra: remove asserts on task nullity
2018-07-03 15:47:23 -05:00
Jafar Al-Gharaibeh
7f04893904
Merge pull request #2619 from pguibert6WIND/show_ipv6_bgp_wrong
doc: bgp wrong command displayed
2018-07-03 10:47:27 -05:00
Lou Berger
3ebe5e5091
Merge pull request #2615 from chiragshah6/evpn_dev
bgpd: l3vni del to free ip prefix routes from vrf
2018-07-03 11:45:53 -04:00
Quentin Young
9c8726a33e doc: clean up flowspec.rst
* Fix broken citations
* Remove trailing whitespace
* Rewrap to 80 lines
* Tweak capitalization of section headers
* Clean up a few indented blocks

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-07-03 17:42:41 +02:00
Lou Berger
b0b3080e0f
Merge pull request #2598 from dslicenc/cm21429-vrf-dup
zebra: duplicate nexthops for cross-vrf static routes on vrf bounce
2018-07-03 11:39:38 -04:00
Lou Berger
b99af60a40
Merge pull request #2599 from pacovn/PVS-Studio_Array_overrun
ospfd zebra: array overrun fixes (PVS-Studio)
2018-07-03 11:37:34 -04:00
Marcel Röthke
e42346020e bgpd: fix rpki validation for ipv6
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2018-07-03 16:19:21 +02:00
F. Aragon
b575a12c87
bgpd lib ospfd pimd ripngd: null chk (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-03 15:39:50 +02:00
Philippe Guibert
a69601ac33 doc: bgp wrong command displayed
This command does not exist. Move it to the right one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-03 15:01:21 +02:00
F. Aragon
e1fa928d22
ospfd zebra: array overrun fixes (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-03 11:34:40 +02:00
Martin Winter
6f68fba107
Merge pull request #2516 from rubenk/more-spec-cleanups
More spec cleanups
2018-07-03 00:32:57 -07:00
Donald Sharp
9e79ccf3dc
Merge pull request #2609 from pacovn/clang_scan_nhrpd_vici_initialization
nhrpd: uninitialized variable (Clang scan)
2018-07-02 18:49:49 -04:00
Chirag Shah
d846168d35 bgpd: l3vni del to free ip prefix routes from vrf
In Symmetric routing case, L3VNI stores evpn MAC_IP routes
as IP_PREFIX routes in associated bgp_vrf and fib.

When vxlan device for l3vni goes down, triggers l3vni delete
in bgp.
As part l3vni delete, evpn ip prefix routes associated
with the vni need to be withdrawn from zebra as well
bgpinfo needs to be freed.
bgp_delete does not free bgp_info associated
to evpn ip prefix routes (link to bgp_vrf).
Call to uninstall_evpn_route_entry_in_vrf() properly
cleanup bgp_info as well triggers appropriate updates.

Ticket:CM-21443
Testing Done:
On DUT, bringup symmetric routing configuration, learn
EVPN Type-2 and Type-3 Routes.
Type-2 MAC_IP routes will be stored as ip_prefix in vrf table
during l3vni bring up.

Remove L3vni, deletes all ip_prefix routes from the zebra, kernel
vrf route table and bgp_info is freed.

Check the show bgp memory stats for bgp_info post l3vni flap.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-07-02 14:48:33 -07:00
Quentin Young
6945779cec
Merge pull request #2604 from pacovn/PVS-Studio_odd_operator_usage
nhrpd: odd operator usage fix (PVS-Studio)
2018-07-02 14:18:26 -04:00
Quentin Young
cab3de7e27
Merge pull request #2603 from pacovn/PVS-Studio_format_warnings
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
2018-07-02 14:15:43 -04:00
F. Aragon
7ea5df54b6
nhrpd: uninitialized variable (Clang scan)
Fix over 0a939f4f24 (there was a case not
covered by previous fix)

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 20:07:59 +02:00
Quentin Young
7012f1a38c zebra: remove asserts on task nullity
While ZAPI I/O threads make a best effort to kill any scheduled tasks on
their threadmasters, after death another pthread can continue to
schedule onto the threadmaster. This isn't a problem per se since the
tasks will never run, but it also means that asserting that it hasn't
happened is pointless.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-07-02 18:07:28 +00:00
F. Aragon
a85297a7c9
bgpd zebra: element overflow (PVS-Studio)
The warning given by PVS-Studio is related to per-element overflow (there is
no real overflow, because of how elements are mapped in the union). This
same warning is typically reported by Coverity, too.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 19:06:54 +02:00
Donald Sharp
a566aa95b3
Merge pull request #2601 from pacovn/PVS-Studio_scope_overlap
ripngd: variable scope overlap fix (PVS-Studio)
2018-07-02 12:44:10 -04:00
Quentin Young
feed25a9a5
Merge pull request #2600 from pacovn/PVS-Studio_sizeof_and_dead_code
eigrpd: sizeof() usage + dead code (PVS-Studio)
2018-07-02 12:41:34 -04:00
F. Aragon
0651460e00
eigrpd nhrpd ospfd pimd: fomat fixes (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 17:50:21 +02:00
Quentin Young
36789dd4b5
Merge pull request #2533 from pguibert6WIND/doc_flowspec
doc: add flowspec information from user point of view
2018-07-02 11:42:22 -04:00
F. Aragon
c4822682d1
nhrpd: odd operator usage fix (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 17:37:23 +02:00
F. Aragon
ee6f77577c
ripngd: variable scope overlap fix (PVS-Studio)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 16:53:16 +02:00
F. Aragon
885c8244cf
eigrpd: sizeof() usage + dead code (PVS-Studio)
Two issues:

1) Removed an unnecesary null check of 'ei'
2) Fixed the usage of sizeof(), as it was used the size of a pointer instead
   of the size of the structure

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-07-02 16:44:46 +02:00
Don Slice
3b88f2e60a zebra: duplicate nexthops for cross-vrf static routes on vrf bounce
Problem created by the fix for cm-21306 (inactive cross-vrf static routes
when vrfs were bounced.)  Determined that in another case, that fix would
cause duplicate nexthops to appear in the table. Resolved the problem by
removing the vrf static route process from the zebra "add" process leaving
it in the zebra " if up" process as added in cm-21306 since that's the point
that the vrf device is now functional.

Ticket: CM-21429
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-02 14:01:33 +00:00
Philippe Guibert
53b758f3e2 doc: fix missing bgp keyword in debug bgp command
Some debug bgp commands were missing bgp keyword.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-02 11:47:57 +02:00
Philippe Guibert
00458d014a doc: add flowspec information from user point of view
Add some information for BGP flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-02 11:47:57 +02:00
Russ White
8d6d6b2581
Merge pull request #2475 from LabNConsulting/working/master/no_vrf_socket_4l3mdev
Don't open per vrf sockets when net.ipv4.tcp|udp_l3mdev_accept != 0
2018-07-01 23:06:22 -04:00
Donald Sharp
b9778ba7c2
Merge pull request #2593 from rtrlib/2018-07-01-master-bugfix
bgpd: fix rpki segfault
2018-07-01 19:40:57 -04:00
Marcel Röthke
92110aabe4 bgpd: fix rpki segfault
If a cache server was added after rpki was started it's tr_socket would
not be initialized. This would lead to a segfault if the rtr manager
ever decides to switch to that socket or if rpki support is stopped.

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2018-07-01 22:57:36 +02:00
G. Paul Ziemba
3bd70bf8f3 bgpd: fix NULL dereference in vrf-vpn leak config if before default instance
Issue 2473

VRF-VPN route-leaking configuration commands assumed existence of
default bgp instance. If a non-default vrf configuration occurred
before the default vrf configuration, it would result in a (NULL)
dereference to the non-existent default vrf.

This change 1) detects non-existence of default vrf and skips corresponding
RIB updating that normally occurs during configuration changes of the
route-leaking parameters; and 2) when the default bgp instance is defined,
runs the deferred RIB updating.

In vpn_leak_to_vrf_update_all(), replace early return if bgp_vpn is NULL
with assert, as the former would lead to subtly wrong RIB contents. The
underlying issue that led to commit 73aed5841a
should be fixed by the above changes.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-06-30 10:09:23 -07:00