Commit Graph

18714 Commits

Author SHA1 Message Date
bisdhdh
5f9c1aa29e bgpd: Fix for BGP core when connected routes are redistributed
& GR is enabled.

When GR with deferral is enabled and connected routes are
distributed then in one race condition route node gets added
in to both deferred queue and work queue. If deferred queue
gets processed first then it ends up delete only flag while
leaving the entry in the work queue as it is. When a new update
comes for the same route node next time from peer then it hits
assert. Assert check is added to ensure we don’t add to work queue
again while it is already present.
So, check before adding in to deferred queue if it is already present
in work queue and bail if so.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
5cce3f0544 bgpd: Adding BGP GR change mode config apply on notification sent & received.
* Changing GR mode on a router needs a session reset from the
SAME router to negotiate new GR capability.
* The present GR implementation needs a session reset after every
new BGP GR mode change.
* When BGP session reset happens due to sending or receiving BGP
notification after changing BGP GR mode, there is no need of
explicit session reset.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
3a75afa4b9 bgpd: Adding BGP GR Neighbour mode show, when local mode is “Disable”.
* BGP GR Neighbour mode in show command would show as
“NotApplicable”, when local mode is “Disable”. As the bgp
gr neighbour capability was not processed, since the local mode
is “Disable”.
* Minor changes in show Selection Deferral Time.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
f009ff2697 bgpd: Adding Selection Deferral Timer handler changes.
* Selection Deferral Timer for Graceful Restart.
* Added selection deferral timer handling function.
* Route marking as selection defer when update message is received.
* Staggered processing of routes which are pending best selection.
* Fix for multi-path test case.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
cfd47646b3 bgpd: Adding changes for Selection Deferral Timer config cmd
and DS.

* Added config commands and data structures for deferral timer
configuration and processing.
Cmd : bgp graceful-restart select-defer-time (0-3600)
Cmd : no bgp graceful-restart select-defertime (0-3600)

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
Signed-off-by: Soman K S <somanks@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
2986cac299 bgpd: Adding BGP GR Per Neighbor show commands.
* Added new show command to show the graceful restart
information for each neighbor.
Cmd: show bgp [<ipv4|ipv6>] neighbors [<A.B.C.D|X:X::X:X|WORD>] graceful-restart
* Changes to show neighbors commands for displaying
graceful restart information.
Cmd :show [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6>] neighbors [<A.B.C.D|X:X::X:X|

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
055679e915 bgpd: Adding BGP GR Per Neighbor config commands.
* Added configuration commands for enabling and disabling graceful restart
per neighbour.
Cmd : neighbor A.B.C.D graceful-restart
Cmd : no neighbor A.B.C.D graceful-restart
Cmd : neighbor A.B.C.D graceful-restart-helper
Cmd : no neighbor A.B.C.D graceful-restart-helper
Cmd : neighbor A.B.C.D graceful-restart-disable
Cmd : no neighbor A.B.C.D graceful-restart-disable
* Added configuration commands for disabling graceful restart at the global
Level.
Cmd : bgp graceful-restart disable
Cmd : no  bgp graceful-restart disable

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
034e185dc6 bgpd: BGP GR advertise capabilities in the open message.
* Changes to the capability sending function to advertise
graceful restart capability in the bgp OPEN message.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
794b37d521 bgpd: Adding BGP GR Global & Per Neighbour FSM changes
* Added FSM for peer and global configuration for graceful restart
 * Added debug option BGP_GRACEFUL_RESTART for logs specific to
 graceful restart processing

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
bisdhdh
b0965c44e9 bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.
This pr contains all the header files changes for BGP GR per Neighbour(BGPN)
feature.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
Donald Sharp
56f9b9bf15 doc: Update ospf unnumbered documentation
Update the ospf unnumbered documentation to reflect how
to get it working under linux.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-22 17:27:58 -05:00
Donald Sharp
3d7660fa85 tests: Test ospf unnumbered behavior and ensure that it works
Recent commit: 0eb97b860d

Broke onlink behavior and as a result ospf unnumbered failed
to work.  This commit adds a small test to create 2 ospf routers,
connect them through ospf unlinked behavior and then ensure
that the routes are installed into the kernel as expected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-22 17:27:58 -05:00
Donald Sharp
54bea4e537 zebra: Re-add onlink flag due to loss in earlier commit
commit: 0eb97b860d

Removed this chunk of code in zebra:
-       if (ifp)
-               if (connected_is_unnumbered(ifp))
-                       SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);

Effectively if we had a NEXTHOP_TYPE_IPV4_IFINDEX we would
auto set the onlink flag.  This commit dropped it for some reason.

Add it back in an intelligent manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-22 17:10:20 -05:00
Quentin Young
abe5af1774
Merge pull request #5412 from opensourcerouting/bfdd-vrf-fix
bfdd: fix multiple VRF handling
2020-01-22 14:14:21 -05:00
Quentin Young
663d3a9115 zebra: check afi validity in vrf label message
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-22 14:12:15 -05:00
Quentin Young
d35e556c84 lib: add macro to check if value is valid afi
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-22 14:12:15 -05:00
Mark Stapp
8015874dcd
Merge pull request #5710 from opensourcerouting/fix_centos6
lib: Fix missing __be16 typedef on CentOS6
2020-01-22 08:22:48 -05:00
Donatas Abraitis
fa7f9d61eb
Merge pull request #5656 from pguibert6WIND/import_evpn_entries
bgpd: import evpn entries with nexthop self attribute
2020-01-22 10:21:59 +02:00
Sri Mohana Singamsetty
e164eb7012
Merge pull request #5473 from yasuhiro-ohara-ntt/ospf6d-self-orig-maxage-fix
ospf6d: ospf6_flood.c: self-originated MaxAge LSAs to install and refresh.
2020-01-21 22:34:04 +05:30
David Lamparter
42440fcfa6
topotest: minor doc, lutil, sharpd not compiled changes (#5675)
topotest: minor doc, lutil, sharpd not compiled changes
2020-01-21 17:32:59 +01:00
David Lamparter
b7b3d466eb bfdd: fix format strings
... now that we get warnings about them ...

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-21 16:35:00 +01:00
David Lamparter
d85b048d48 bfdd: remove logging shim
This does exactly nothing, other than hiding format warnings...

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-21 16:35:00 +01:00
Mark Stapp
cb6070bd79 zebra: include zebra nexthop debug in show runn
Add show output for 'debug zebra nexthop [detail]' category.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-01-21 09:26:44 -05:00
Lou Berger
dccb75bbcf topotest: log results summary at end of lutil run
Signed-off-by: Lou Berger <lberger@labn.net>
2020-01-21 06:27:43 -05:00
Lou Berger
fe5bf01531 topotest: bgp_l3vpn_to_bgp_vrf - catch case of sharpd not being compiled
Signed-off-by: Lou Berger <lberger@labn.net>
2020-01-21 06:27:43 -05:00
Lou Berger
dc935a5147 doc: recommend compiling with sharpd to enable scaling testing
Signed-off-by: Lou Berger <lberger@labn.net>
2020-01-21 06:27:43 -05:00
Martin Winter
beec2cfe57 lib: Fix missing __be16 typedef on CentOS6
Need to include linux/types.h on older Linux

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-01-20 15:40:49 +01:00
David Lamparter
a5586bb6be
doc: add instructions for static linking (#5668)
doc: add instructions for static linking
2020-01-20 10:42:29 +01:00
Donatas Abraitis
9e1ecdbaa4
Merge pull request #5707 from donaldsharp/nexthop_encoding
Nexthop encoding
2020-01-18 23:25:56 +02:00
Donald Sharp
12b76399a8 tests: Add another router to the basic pim tests
Add an additional router to the basic pim tests.
1) This test will add a link between r1 and a new rp
2) This test will ensure that r1 and rp have the expected
who is the rp.
3) This test will ensure that the rp has received the upstream
data for the multicast stream that is started.

Ostensibly commit
68a02e06e5 is the first bad commit
commit 68a02e06e5
Author: Mark Stapp <mjs@voltanet.io>
Date:   Wed Nov 13 16:06:06 2019 -0500
    *: revise zapi nexthop encoding
    Use a per-nexthop flag to indicate the presence of labels; add
    some utility zapi encode/decode apis for nexthops; use the zapi
    apis more consistently.
    Signed-off-by: Mark Stapp <mjs@voltanet.io>

Sparked this commit in that it broke nexthop reporting to upper
level protocols.  Ensure that this expectation stays working
in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-18 13:47:29 -05:00
Donald Sharp
b6cac82ed9
Merge pull request #5703 from ton31337/feature/limit_outgoing_prefixes
bgpd: Add an option to limit outgoing prefixes
2020-01-18 12:20:44 -05:00
Donald Sharp
50d5de4880
Merge pull request #5704 from opensourcerouting/build-cleanup-20200117
build: random cleanups
2020-01-18 12:09:45 -05:00
Donald Sharp
9d080116b9 lib: Fix nexthop encoding
Commit
68a02e06e5 broke nexthop encoding
for nexthop tracking.

This code combined the different types of nexthop encoding
being done in the zapi protocol.  What was missed that
resolved nexthops of type NEXTHOP_TYPE_IPV4|6 have an ifindex
value that was not being reported.  This commit ensures
that we always send this data( even if it is 0).

The following test commit will ensure that this stays working
as is expected by an upper level protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-18 09:29:30 -05:00
Rafael Zalamena
06603017b1
Merge pull request #5701 from ton31337/fix/remove_peer_scount
bgpd: Remove peer->scount
2020-01-17 17:27:24 +00:00
David Lamparter
7fb434ef85 build: fix auto git ID length
This script was written back when `git describe` would abbreviate to
7-char commit IDs;  they're longer now and we're grabbing the tail
end...

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-17 15:54:50 +01:00
David Lamparter
d60693fdf8 build: accept libunwind without pkg-config
NetBSD installs LLVM's libunwind without a pkg-config file, but it
works perfectly fine.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-17 15:50:50 +01:00
Donatas Abraitis
8117418824 tests: Add test for neighbor <X.X.X.X> maximum-prefix-out <Y>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 16:20:30 +02:00
Donatas Abraitis
fde246e835 bgpd: Add an option to limit outgoing prefixes
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 16:20:28 +02:00
Donatas Abraitis
edf98aa365 doc: Add some words about neighbor <X> maximum-prefix-out cmd
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 16:03:38 +02:00
David Lamparter
9c1be10509 build: fix shell == mis-use
The "test" program uses =, not ==.  A lot of shells accept == as an
extension, but not all do and it's technically out of spec.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-17 13:53:59 +01:00
David Lamparter
9b7f9dadf4
configure.ac: add --enable-clang-coverage (#5698)
configure.ac: add --enable-clang-coverage
2020-01-17 11:38:44 +01:00
Donatas Abraitis
8c8ba688bc bgpd: Remove peer->scount
Looks like it's not used anywhere.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 11:02:00 +02:00
Donatas Abraitis
dda8dbd32c
Merge pull request #5699 from qlyoung/zebra-iprule-print-unknown-family-as-number
zebra: print unknown rule family as number
2020-01-17 10:23:08 +02:00
Donatas Abraitis
82074aad89
Merge pull request #5686 from qlyoung/fix-bgp-fqdn-capability-leak
bgpd: fix memory leak when parsing capabilities
2020-01-17 10:22:26 +02:00
Quentin Young
cc815be71a zebra: print unknown rule family as number
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 20:53:10 -05:00
Quentin Young
8ad8599e7a
Merge pull request #5694 from kooky/bfd_doc
doc: Note about BFD debug logging
2020-01-16 17:47:10 -05:00
Quentin Young
b4fd9ea7f0 configure.ac: add --enable-clang-coverage
Like gcov but better!
Also has a driveby fix for --enable-dev-build being mutually exclusive
with --enable-gcov...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 16:26:22 -05:00
Quentin Young
b147e20433 zebra: fix ipset, iptable, ipset entry memleaks
Removed from hash, but not freed, on client disconnect.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 13:31:34 -05:00
Quentin Young
aba5353c17 bgpd: fix memory leak when parsing capabilities
Duplicated domain name capability messages cause memory leak. The amount
of leaked memory is proportional to the size of the duplicated
capabilities. This bug was introduced in 2015.

To hit this, a BGP OPEN message must contain multiple FQDN capabilities.
Memory is leaked when the hostname portion of the capability is of
length 0, but the domainname portion is not, for any of the duplicated
capabilities beyond the first one.

https://tools.ietf.org/html/draft-walton-bgp-hostname-capability-00

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 12:50:27 -05:00
Quentin Young
cce3ef382e doc: add instructions for static linking
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 12:47:34 -05:00