Commit Graph

20148 Commits

Author SHA1 Message Date
Ruben Kerkhof
7075f6a058 build: quote the right hand side of tests too
For consistency

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 11:53:15 +01:00
Ruben Kerkhof
9377fc4f5d build: always quote variables in tests
If they are not defined, ./configure will throw hard to debug errors
like:
./configure: line 1678: test: =: unary operator expected

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 11:27:04 +01:00
Ruben Kerkhof
83e7e1d774 isisd: fix a bunch of build warnings with GCC 10
GCC 10 thinks we memcpy into a 0-sized array (which we're not).
Use a C99 flexible array member instead.

Fixes:

  CC       lib/stream.lo
lib/stream.c: In function ‘stream_put_in_addr’:
lib/stream.c:824:2: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=]
  824 |  memcpy(s->data + s->endp, addr, sizeof(uint32_t));
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

isisd/isis_tlvs.c: In function ‘auth_validator_hmac_md5’:
isisd/isis_tlvs.c:4279:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
 4279 |  memcpy(STREAM_DATA(stream) + auth->offset, auth->value, 16);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘update_auth_hmac_md5’,
    inlined from ‘update_auth’ at isisd/isis_tlvs.c:3734:4,
    inlined from ‘isis_pack_tlvs’ at isisd/isis_tlvs.c:3897:2:
isisd/isis_tlvs.c:3722:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
 3722 |  memcpy(STREAM_DATA(s) + auth->offset, digest, 16);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
isisd/isis_tlvs.c:3722:2: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 10:39:35 +01:00
Donatas Abraitis
7b26b14467
Merge pull request #5962 from donaldsharp/whichafisafi
bgpd: When deleting an afi/safi and we fail give more detail
2020-03-11 11:18:02 +02:00
Donatas Abraitis
03d15b1073
Merge pull request #5957 from pguibert6WIND/two_bfd_fixes
Two bfd fixes
2020-03-11 11:17:32 +02:00
Sri Mohana Singamsetty
e5d9aae349
Merge pull request #5938 from donaldsharp/redistribute_afi
zebra: Only redistribute default routes of the right afi
2020-03-10 15:32:16 -07:00
Sri Mohana Singamsetty
366db7c5df
Merge pull request #5961 from rubenk/build-fix-werror-undef
build: fix building with -Werror=undef
2020-03-10 14:30:45 -07:00
Donald Sharp
601837df84 bgpd: When deleting an afi/safi and we fail give more detail
It would be nice to know which afi/safi we couldn't delete
on a peer in the flog message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10 14:54:18 -04:00
Ruben Kerkhof
1e20238af5 treewide: fix some issues found with -Werror=undef
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-10 16:53:13 +01:00
Quentin Young
4a652d9227
Merge pull request #5951 from rubenk/docs-fix-warning
Fix a warning while building manpages
2020-03-10 11:40:41 -04:00
Quentin Young
4c3fa2b30c
Merge pull request #5953 from ton31337/fix/move_coccinelle_to_tools
tools: Move scripts/coccinelle to tools/coccinelle
2020-03-10 11:36:59 -04:00
Ruben Kerkhof
7cda3a87d1 build: fix building with -Werror=undef
In the unlikely event you are building with -Werror=undef, several
configure checks fail. Fix those.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-10 16:27:50 +01:00
Donatas Abraitis
fcf6ec4cb4
Merge pull request #5877 from donaldsharp/pim_shutdown_cleanup
Pim shutdown cleanup
2020-03-10 17:05:12 +02:00
Donald Sharp
54422b46f7 doc: Add show bgp listener command
Add a bit of debug to show the listener sockets and who created them
to associate with strace output for a developer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10 10:02:43 -04:00
vivek
67bd620c9d bgpd: Fix router-id update handling for route-leaking
If the default BGP instance is importing routes from another instance and
the latter has a router-id update, the update handler needs to handle the
default instance in a special way.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

Ticket: CM-26007
Reviewed By: CCR-9108
Testing Done: Detailed verification in 3.x
2020-03-10 10:02:43 -04:00
vivek
087a1c6ce0 bgpd: Ensure NHT registration is not attempted for peer-group
Ensure that the late registration for NHT done for IPv4 route exchange
over IPv6 GUA peering is not attempted for peer-groups, only for peers.

Fixes: "bgpd: Late registration of Extended Nexthop"
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10 10:02:43 -04:00
vivek
4b3f26f4c9 zebra: Readd special flood MAC upon del notification
Readd the special MAC that represents the flood (head-end replication) entry
for EVPN-VxLAN upon getting a delete notification for it.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Chirag Shah <chirag@cumulusnetworks.com>

Ticket:  CM-25797
Ticket: CM-26238
Testing Done:
1. evpn-min, evpn-smoke - results summarized in CM-25798
2020-03-10 10:02:43 -04:00
Quentin Young
fae5f3c125 lib: immediately ping systemd when started
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-10 09:59:56 -04:00
Donald Sharp
6d7c0df5b4 pimd: ifchannel deletion should tell you the interface
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10 09:59:56 -04:00
Chirag Shah
7c26c12106 zebra: add debug in specific neigh fetch
add debug trace in specific neigh request send api
to help debug an issue where synchronous response parse
returns with NLMSG_DONE where there is no ipv6 neigh received.
the count value is set to 1 because the request contained
a spcific neigh.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-03-10 09:59:56 -04:00
Donald Sharp
2a0e69ae3c bgpd: Add 'show bgp listeners' command for diagnostics
Add a command to display listen sockets and the vrf that they
are associated with.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10 09:59:56 -04:00
Mark Stapp
2bdced5ab3
Merge pull request #5955 from dslicenc/v6-ra-leak
zebra: delete ipv6 RA prefix entries when zebra is killed
2020-03-10 09:53:42 -04:00
Philippe Guibert
bd540576af bgpd: reset bfd session when bgp comes up
This scenario has been seen against microtik virtual machine with bfd
enabled. When remote microtik bgp reestablishes the bgp session after a
bgp reset, the bgp establishment comes first, then bfd is initialising.
The second point is true for microtik, but not for frrouting, as the
frrouting, when receiving bfd down messages, is not at init state.
Actually, bfd state is up, and sees the first bfd down packet from bfd
as an issue. Consequently, the BGP session is cleared.
The fix consists in resetting the BFD session, once BGP comes up. That
permits to align state machines of both local and remote bfd.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-03-10 14:40:31 +01:00
Philippe Guibert
e7db872b81 bgpd: upon reconfiguration or bgp exchange failure, stop bfd.
When bgp is updated with local source, the bgp session is reset; bfd
also must be reset. The bgp_stop() handler handles all kind of
unexpected failures, so the placeholder to deregister from bfd should be
ok, providing that when bgp establishes, a similar function in bgp will
recreate bfd context.
Note that the bfd session is not reset on one specific case, where BFD
down event is the last reset. In that case, we must let BFD to monitor
the link.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-03-10 14:40:31 +01:00
Don Slice
5a7aea851d zebra: delete ipv6 RA prefix entries when zebra is killed
Memory leak found where ipv6 global prefixes added to the router
advertisement prefix lists were not deleted when the process was
killed.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-03-10 11:07:14 +00:00
Donatas Abraitis
d1fc0cdf06 tools: Move scripts/coccinelle to tools/coccinelle
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 11:41:09 +02:00
Ruben Kerkhof
b62eff0129 docs: fix a warning while building manpages
$ make doc
  SPHINX   doc/manpages/_build/.doctrees/environment.pickle
WARNING: html_static_path entry '_static' does not exist

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-10 10:32:19 +01:00
Donatas Abraitis
73b1082ed9 bgpd: Do not check for a maximum for peer->filter_override
FILTER_MAX is 2, RMAP_MAX is 2. No point here.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 11:29:48 +02:00
Donatas Abraitis
e14175b8a1
Merge pull request #5948 from qlyoung/fix-no-bgp-nexthop-vpn-export
bgpd: fix 'no nexthop vpn export'
2020-03-10 07:37:55 +02:00
Donatas Abraitis
34fdf55d7c
Merge pull request #5949 from qlyoung/doc-fix-cli-source-references-order
doc: CLI source references backwards
2020-03-10 07:36:58 +02:00
Donatas Abraitis
9b5082174c doc: Add rfc7607 to supported RFCs list
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 07:35:13 +02:00
Donatas Abraitis
dfc5fb79d5 tests: Add a test case for BGP_AS_ZERO
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 07:32:18 +02:00
Donatas Abraitis
b354d41bd3
Merge pull request #5950 from qlyoung/fix-null-check-before-xfree-yet-again
lib, zebra: remove nullity check before XFREE...
2020-03-10 07:26:40 +02:00
Quentin Young
5567e8010d lib, zebra: remove nullity check before XFREE...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-09 18:16:32 -04:00
Russ White
7f6c322d50
Merge pull request #5839 from donaldsharp/upstream_merge
Upstream merge of missed MLAG code
2020-03-09 15:34:18 -04:00
Quentin Young
455699760f doc: CLI source references backwards
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-09 15:27:25 -04:00
Quentin Young
8c85ca283b bgpd: fix 'no nexthop vpn export'
ALIAS without parameters against DEFPY w/ required parameters doesn't
work

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-03-09 14:55:37 -04:00
Mark Stapp
d0636ead31 lib, *: add a common time interval formatting api
Add a common api that formats a time interval into a string
with different output for short and longer intervals. We do
this in several places, for cli/ui output.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-09 11:12:32 -04:00
Donald Sharp
5cb1323595
Merge pull request #5942 from patrasar/2438087
pimd: Display mroute uptime per (s,g) entry
2020-03-09 08:47:10 -04:00
Sarita Patra
dfd12d0255 pimd: Display mroute uptime per (s,g) entry
Issue: show ip mroute displays the mroute uptime (time when
mroute installed into the kernel) per oif.
This is confusing.

Fix: Display mroute uptime per (s,g) mroute entry.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2020-03-09 00:30:34 -07:00
Donatas Abraitis
4c2a712d93
Merge pull request #5919 from qlyoung/fix-vrrp-mvl-uaf
vrrpd: Fix heap uaf when handling interface deletions
2020-03-09 08:03:34 +02:00
Donald Sharp
6f6daec59c
Merge pull request #5936 from rubenk/ldpd-fix-some-more-linking-issues-with-gcc10
Ldpd: fix some more linking issues with gcc10
2020-03-08 20:04:42 -04:00
Donald Sharp
ac0442fccb
Merge pull request #5922 from pguibert6WIND/nhrp_override_fix
Revert "nhrpd: ignore zebra updates about our routes being deleted/ad…
2020-03-08 20:03:14 -04:00
Donald Sharp
e3ee60b18b
Merge pull request #5935 from rubenk/tests-fix-linking-with-gcc10
tests: fix build with GCC 10
2020-03-08 20:01:38 -04:00
Donald Sharp
a9c5346c29
Merge pull request #5937 from ton31337/fix/sizeof
*: Replace `sizeof something` to sizeof(something)
2020-03-08 20:01:10 -04:00
Donald Sharp
29a353323f zebra: Only redistribute default routes of the right afi
Upper level clients ask for default routes of a particular family
This change ensures that they only receive the family that they
have asked for.

Discovered when testing in ospf `default-information originate`

=================================================================
==246306==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffa2e8 at pc 0x7ffff73c44e2 bp 0x7fffffffa090 sp 0x7fffffffa088
READ of size 16 at 0x7fffffffa2e8 thread T0
    #0 0x7ffff73c44e1 in prefix_copy lib/prefix.c:310
    #1 0x7ffff741c0aa in route_node_lookup lib/table.c:255
    #2 0x5555556cd263 in ospf_external_info_delete ospfd/ospf_asbr.c:178
    #3 0x5555556a47cc in ospf_zebra_read_route ospfd/ospf_zebra.c:852
    #4 0x7ffff746f5d8 in zclient_read lib/zclient.c:3028
    #5 0x7ffff742fc91 in thread_call lib/thread.c:1549
    #6 0x7ffff7374642 in frr_run lib/libfrr.c:1093
    #7 0x5555555bfaef in main ospfd/ospf_main.c:235
    #8 0x7ffff70a2bba in __libc_start_main ../csu/libc-start.c:308
    #9 0x5555555bf499 in _start (/usr/lib/frr/ospfd+0x6b499)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-08 18:50:25 -04:00
Donatas Abraitis
0d6f7fd6fd *: Replace sizeof something to sizeof(something)
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-08 21:44:53 +02:00
Ruben Kerkhof
f3faea7fe3 ldpd: remove multiple definitions of thread_master
This fixes the last issue compiling FRR with GCC 10 on Fedora Rawhide.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-08 20:21:55 +01:00
Ruben Kerkhof
54ca644b6e ldpd: fix another linking issue with GCC-10
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-08 20:18:11 +01:00
Donald Sharp
ec03d9e3a4
Merge pull request #5934 from rubenk/ldpd-fix-linking-error-with-gcc-10
Fix linking error on Fedora Rawhide with GCC 10
2020-03-08 13:47:03 -04:00