Commit Graph

29152 Commits

Author SHA1 Message Date
ARShreenidhi
f10d6c5b0b tests : bgp_default_originate testcase w.r.t topology1 added
this PR contains the basic bgp default originate.
Details of the testcase is available in respective script files

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-06-21 06:25:20 +00:00
Donatas Abraitis
77be6d6a23 bgpd: Show cache server preference in show rpki cache-server output
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 22:49:32 +03:00
Donatas Abraitis
8eb7f5fce8 doc: Specify preference for RPKI cache server
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 22:44:29 +03:00
Donatas Abraitis
11423e5029 bgpd: Generate RPKI CLI config even if no cache servers configured
If we have more CLI options configured and the last cache server is removed,
then the whole RPKI section is dropped.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 22:41:20 +03:00
Donatas Abraitis
2a5f5ec00f bgpd: Drop SSH public key for RPKI CLI option
It's not used anywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 22:23:07 +03:00
Donatas Abraitis
cc22635ac4 bgpd: Allow deleting full line for RPKI cache server
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 21:29:18 +03:00
Donatas Abraitis
8156765abe bgpd: Add no rpki command
To delete the whole RPKI section.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 20:56:32 +03:00
Donatas Abraitis
0ebabd4107 bgpd: Increase peer->flags to uint64_t
We will hit the limit soon, let's increase this in advance.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-20 20:21:26 +03:00
Igor Ryzhov
2af482767c
Merge pull request #11146 from NicolasDichtel/master
lib/if: fix interface name comparison
2022-06-20 19:54:35 +03:00
Donatas Abraitis
298ff7e357
Merge pull request #11284 from ordex/prefixlen_count
bgpd: Allow statistics gathering to give more data about prefix Lengths
2022-06-20 11:08:39 +03:00
Donatas Abraitis
4ed0abcb55
Merge pull request #11423 from donaldsharp/lgtm_fixes
Lgtm fixes
2022-06-19 22:33:01 +03:00
Donatas Abraitis
ee91e848ff
Merge pull request #11431 from donaldsharp/bgp_cleanups
Add some extra data for when things might be going wrong
2022-06-19 12:02:56 +03:00
anlan_cs
f1f4a65288 zebra: remove redundant calling hook for fpm
Since the calling hook for old fpm is done in `rib_uninstall_kernel()`
inside, this calling place outside should be redundant. Just remove it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-06-17 17:42:12 -04:00
Donald Sharp
c08f56304b lib: Add some extra error messages for when things go wrong
In sockunion.c let's eliminate the silent and unexpected failure
mode to let the end operator figure out something is terribly wrong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-17 13:47:03 -04:00
Donald Sharp
1e592331cb bgpd: Display useful values when using json for missing neighbor state
When a peer has not established connection yet, these values:
`hostLocal`, `portLocal`, `hostForeign`, `portForeign` might
not have any values and json output will not display anything
for them.  Modify the code to display some nominal values in
this situation so that parsers are not surprised.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-17 13:43:30 -04:00
Mark Stapp
0f9e2c918b ospf6: permit route delete without nexthops
It's possible for ospf6 to decide to delete a route after it's
removed all of the route's nexthops. It's ok to delete a prefix
alone - be a little more forgiving when preparing a route delete.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-06-17 11:47:55 -04:00
Rafael Zalamena
38437392b9
Merge pull request #11425 from LabNConsulting/chopps/cleanup-redherring-memleaks
lib: cleanup red-herring memleaks in parent of daemonizing fork
2022-06-17 08:31:07 -03:00
Eugene Bogomazov
d864dd9eb1 bgpd: Add RFC9234 implementation
RFC9234 is a way to establish correct connection roles (Customer/
Provider, Peer or with RS) between bgp speakers. This patch:
- Add a new configuration/terminal option to set the appropriate local
role;
- Add a mechanism for checking used roles, implemented by exchanging
the corresponding capabilities in OPEN messages;
- Add strict mode to force other party to use this feature;
- Add basic support for a new transitive optional bgp attribute - OTC
(Only to Customer);
- Add logic for default setting OTC attribute and filtering routes with
this attribute by the edge speakers, if the appropriate conditions are
met;
- Add two test stands to check role negotiation and route filtering
during role usage.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-17 13:14:46 +03:00
Christian Hopps
1213e46bfd
lib: cleanup red-herring memleaks in parent of daemonizing fork
- The parent of the daemonizing fork reports memleaks for the early
northbound allocations (libyang). If these were real memleaks these
would show up in the child as well; however, ignoring all memleaks in
the parent of the fork is too hard a sale. Instead, spend some CPU
cycles cleaning up the allocations in the parent after the fork and
immeidatley prior to exiting the parent after the daemonizing fork.

Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-17 02:14:30 -04:00
Donald Sharp
4151ca0ada
Merge pull request #11422 from opensourcerouting/feature/autoclose_stale_issues_prs
github: Autoclose stale issues/PRs that are stare longer than 180 days
2022-06-16 16:36:36 -04:00
Donald Sharp
8dfcf20fa0
Merge pull request #11419 from anlancs/fix/minor-1
zebra, lib: minor changes
2022-06-16 16:35:38 -04:00
Donald Sharp
00c89a3673 lib: Function crypt does not need to be declared mid function
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donald Sharp
6fd04fda31 eigrpd: vrf variable name hides a parameter of the same name
vrf is a char * being passed in.  Rename the vrf to be something
else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donald Sharp
0474ad9c72 python: Remove redundant import of subprocess
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donald Sharp
87472c6999 zebra: ret is always -1 or 0 at this point so remove the if test
Remove the if test and cleanup the code to better align.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donald Sharp
7aa77e557b ospf6d: cost is uint32_t so it cannot be greater than UINT32_MAX
Remove the extra test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donald Sharp
45f68cb8b4 nhrpd: r is always < 0 at some points of if else statements
Since r is always < 0 at the last if/else there is no point
in testing for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donatas Abraitis
38ec6e680d
Merge pull request #11421 from donaldsharp/bgp_psu
bgpd: Use %pSU instead of sockunion2str
2022-06-16 23:17:18 +03:00
Martin Winter
7bd83409d2
Merge pull request #11410 from donaldsharp/daemons_cleanup 2022-06-16 20:58:27 +02:00
Donatas Abraitis
0c687ea4c1 github: Autoclose stale issues/PRs that are stare longer than 180 days
Set autoclose label after 180 days (no activity) and close (really) two weeks
later.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-16 21:54:55 +03:00
Donald Sharp
ddf6338c03 bgpd: Use %pSU instead of sockunion2str
Commit: 09f267ec95 introduced more sockunion2str
usages when FRR should be using %pSU.  This commit
broke the compile when using --enable-dev-build

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:59 -04:00
Donald Sharp
c9af62e314 zebra: Add a configurable knob zebra nexthop-group keep (1-3600)
Allow end operator to set how long a nexthop-group is kept around
in the system after it is no-longer being used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donald Sharp
35729f38fa zebra: Add a timer to nexthop group deletion
Before deleting nexthop groups, that are installed,
from the system, start a timer and hold the nexthop
group for that time.

Suppose you have this scenario

a) create a static route with 1 x ecmp
      creates a nhg with 1 x ecmp
b) create a static route with 2 x ecmp
      creates a nhg with 2 x ecmp
      deletes a's nhg
c) create a static route with 3 x ecmp
      creates a nhg with 3 x ecmp
      deletes b's nhg
d) create a different route with 1 x ecmp
      creates another 1 x ecmp ( since a's ecmp was deleted )
e) create a different route with 2 x ecmp
      creates another 2 x ecmp ( since b's ecmp was deleted )

If you don't delete the nhg, start a timer, the nhg's used
in steps a and b can be reused for steps d and e.  This reduces
overhead work with zebra <-> kernel interactions and improves
the speed of the system.

So modify the code to note that an installed nexthop group should
be kept around a bit and hopefully reused.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donald Sharp
382858d015 zebra: Move where zebra marks a nhg as uninstalled in fib
Currently the code is marking the nhg as uninstalled but not
causing that to flood up to the dependent nhgs:

nhg 3 is a group of 1/2
   1 -> interface A
   2 -> interface B

Suppose A goes down, old code would mark nhg 1 as !VALID and !INSTALLED.
Suppose B then goes down, old code would mark nhg 2 as !VALID and !INSTALLED
But would not mark nhg 3 as !VALID and !INSTALLED (sort of assuming that
it would just be cleaned up by NHG refcounts ).  I would prefer that
the code is pedantic about nhg 3 actually being removed from the system.

This code moves the setting of !INSTALLED into zebra_nhg.c where it
really belongs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donald Sharp
5772319ef1 zebra: Document some data structures better
I keep getting confused about nhg_depends and nhg_dependents.
So take a second and write them down for the next person.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donald Sharp
46179f6f3e bgpd: Use %pSU instead of sockunion2str
Commit: 09f267ec95 introduced more sockunion2str
usages when FRR should be using %pSU.  This commit
broke the compile when using --enable-dev-build

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 14:47:19 -04:00
Donatas Abraitis
aef69e4f39
Merge pull request #11353 from fdumontet6WIND/bmp_src_interface
bmp: add a interface source to bmp connect command
2022-06-16 21:30:28 +03:00
Donatas Abraitis
7ea104c111
Merge pull request #11415 from donaldsharp/interface_duplication_linux
Interface duplication linux
2022-06-16 21:19:14 +03:00
Martin Winter
22ad701ec0
Merge pull request #11408 from donaldsharp/common_config 2022-06-16 18:45:15 +02:00
Quentin Young
e99126f0ac tools: document frr_global_options in daemons file
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:20:36 -04:00
Quentin Young
da9601225f tools: apply various shellcheck recommendations
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:20:36 -04:00
Quentin Young
2469a37fd0 tools: print daemon start cmd, vtysh_b cmd
When starting a daemon, print the full command run by the init script to
start it. This gives more information and is especially helpful when
debugging wrap commands.

Also add some more logs to vtysh_b to print the command used there,
log when we exit early because frr.conf doesn't exist, and simplify the
code path for creating the command to use.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:00:23 -04:00
Quentin Young
66edf91772 tools: clean up whitespace in daemons file
Bit easier to read this way.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:00:23 -04:00
Quentin Young
88323f0f96 tools: improve explanation of watchfrr_options
The explanation block for watchfrr_options was split into two blocks,
one explaining the --netns option and one making a vague statement that
the init script provides the list of daemons to start. The former can be
merged with the latter and the latter is more useful when stated as a
caveat for what you should actually use watchfrr_options for.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:00:23 -04:00
Quentin Young
5e24868b15 tools: improve explanation of 'wrap' options
We support 'wrap' variables in /etc/frr/daemons, but the explanation
given there doesn't touch on some of the subtleties of using these
variables.

The variables were designed for use with Valgrind, which has special
behavior when run with programs that daemonize; Valgrind will intercept
the fork()'d child process and run itself instead of the child. This
behavior allows it to follow the same forking semantics as the target
program.

For virtually every other wrapper, the wrap variables do not work as
demonstrated because the wrapper programs do not daemonize. If the
wrappers do not daemonize, they will block the init script. The examples
given with "perf" for example simply do not work, because perf remains
in the foreground even as it tracks forked children.

This patch adds an explanation of the behavior expected by the init
script and offers a solution for getting that behavior.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-06-16 12:00:23 -04:00
anlan_cs
e3f05a8a1a zebra: adjust one variable name
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-06-16 10:15:12 -04:00
Russ White
93ab9a2c0b
Merge pull request #11409 from donaldsharp/zebra_nhg_debug
Zebra nhg debug
2022-06-16 10:13:20 -04:00
Rafael Zalamena
952071e44a
Merge pull request #11414 from donaldsharp/memory_cannot_fail
Memory cannot fail
2022-06-16 10:58:05 -03:00
anlan_cs
f978382d78 lib: correct two comments
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-06-16 08:39:34 -04:00
Francois Dumontet
09f267ec95 bmp: add a interface source to bmp connect command
With current release, forcin the source ip address when setting up a BMP
connection is not possible.

The need is to add an extra parameter for the following vty command:

router bgp 65500
bmp targets AAA
bmp connect 2.2.2.2 port 666 min-retry 100 max-retry 700
bmp connect 2:2::2:2 port 666 min-retry 100 max-retry 700 [source-interface lo1]

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-06-16 12:51:11 +02:00