Commit Graph

22862 Commits

Author SHA1 Message Date
Karen Schoener
32cfb544e9 isisd, ospfd: increase timeout to fix intermittent LDP Sync test failure
Currently, IGPs are coded to receive a 'hello' message from LDP every second.
Intermittently, LDP Sync topotests are failing because the IGPs fail to
receive this 'hello' message every second.
When the LDP Sync topotests fail, LDP logs show that LDP is processing
zapi messages for 1-2 seconds.

This is a shortterm fix, in order to prevent CI pipeline failures.
The longterm fix is in progress.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-12-03 11:23:59 -05:00
Donald Sharp
d96610aa2d
Merge pull request #7660 from rampxxxx/master
doc: add building steps for openSUSE
2020-12-03 08:29:02 -05:00
Javier Garcia
f5b17d200f doc: add building steps for openSUSE
Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
2020-12-03 11:59:01 +01:00
Rafael Zalamena
f584de526d fpm: reset/walk data structures on connection
Don't attempt to walk data structures while not connected so we can
save some CPU usage when FPM server is offline.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-12-03 07:30:23 -03:00
Rafael Zalamena
1f9193c1f0 fpm: simplify reset logic
Instead of checking for next group reset, always do it and skip sending
if next hop group support is disabled.

Also remove unused `*_complete` variables.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-12-03 07:30:23 -03:00
Rafael Zalamena
a3adec468e zebra,fpm: fix configuration display
Use `pI4` and `pI6` to format addresses and fix a bug when displaying
IPv6 addresses.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-12-03 07:30:23 -03:00
Rafael Zalamena
2a437850fd tools: make frr-reload handle fpm commands
Instruct `frr-reload.py` to not use `fpm` commands as configuration
node.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-12-03 07:30:23 -03:00
Donatas Abraitis
3cc92134a3
Merge pull request #7349 from opensourcerouting/bgp-delayopen
bgpd: RFC 4271 optional session attribute DelayOpenTimer
2020-12-03 08:26:44 +02:00
Donatas Abraitis
c49042b407
Merge pull request #7638 from donaldsharp/reduce_warn
zebra: Reduce warn -> debug
2020-12-03 08:17:59 +02:00
Donald Sharp
0fb4ab0388
Merge pull request #6950 from opensourcerouting/bfd-distributed-v3
bfdd: distributed BFD
2020-12-02 20:50:47 -05:00
Donald Sharp
cb5a294642
Merge pull request #7590 from opensourcerouting/isisd-lfa
isisd: add support for classic LFA
2020-12-02 20:43:51 -05:00
Donald Sharp
dd2a6ddb3e
Merge pull request #7657 from mjstapp/fix_topo_asan_noise
tests: Cleanup topo asan noise
2020-12-02 20:07:53 -05:00
Russ White
fa9f050031
Merge pull request #7625 from donaldsharp/pointtomultipoint
Pointtomultipoint
2020-12-02 13:07:28 -05:00
Donald Sharp
187a74a2c6
Merge pull request #7596 from gpnaveen/ospf_basic
tests : Adding 3 base ospf testcases.
2020-12-02 12:35:43 -05:00
Donald Sharp
d0bd9877b8
Merge pull request #7589 from pguibert6WIND/show_bgp_summary_desc
Show bgp summary desc
2020-12-02 12:18:07 -05:00
ckishimo
b79c30700c ospfd: fix cosmetic show ip ospf when NSSA
When executing the following command to change the NSSA translator role
from OSPF_NSSA_ROLE_ALWAYS to OSPF_NSSA_ROLE_NEVER
r2(config-router)# area 1 nssa translate-never

During the time the `ospf_abr_nssa_check_status()` function is not executed,
we are in a situation where the role is OSPF_NSSA_ROLE_NEVER (just configured)
but the NSSATranslatorState is still ENABLED

During this time the output of "show ip ospf" displays the following:

r2# show ip ospf
 Area ID: 0.0.0.1 (NSSA)
   Shortcutting mode: Default, S-bit consensus: no
   Number of interfaces in this area: Total: 1, Active: 1
   It is an NSSA configuration.
   Elected NSSA/ABR performs type-7/type-5 LSA translation.
   We are an ABR and    Number of fully adjacent neighbors in this area: 1 (**)

Basically the case TranslatorState=ENABLED && TranslatorRole=ROLE_NEVER is not
covered in `ospf_vty.c`

This PR adds the case TranslatorState=ENABLED and TranslatorRole=ROLE_NEVER
which should only happen for a small period of time

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-12-02 08:47:28 -08:00
Donald Sharp
5b264736b8
Merge pull request #7572 from idryzhov/ospf6-cleanup
ospf6 code cleanup
2020-12-02 11:10:48 -05:00
Mark Stapp
c46de798de tests: quiet noisy error log about asan files
Turn a noisy error log into a debug - it's just reporting
that we're _looking_ for asan output.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:38 -05:00
Mark Stapp
6ee4440e66 tests: fix typo in asan variable names
Use AddressSanitizer consistently

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:03 -05:00
Russ White
6bae263648
Merge pull request #7648 from donaldsharp/store_curr_mtu
ospfd: Set Curr_mtu to when we get the mtu
2020-12-02 10:25:42 -05:00
Donald Sharp
ae33f4d1ec
Merge pull request #7612 from deastoe/ospf-vlink-auth-cfg
ospfd: vlink auth type not shown in running config
2020-12-02 09:27:16 -05:00
Donald Sharp
bd842270fe
Merge pull request #7615 from gromit1811/feature_topotest_module_noload
tests: Add TOPOTEST_NOLOAD to skip module loading question
2020-12-02 09:23:30 -05:00
Donald Sharp
af8a77d636
Merge pull request #7644 from mjstapp/dplane_cleaner
zebra: add an api to process/clean the pending dplane queue
2020-12-02 09:01:44 -05:00
Donald Sharp
fe76cf322e
Merge pull request #7646 from volta-networks/fix_show_route_summary
zebra: fix show ip route vrf X summary
2020-12-02 08:59:54 -05:00
ckishimo
58e5d14073 ospfd: fix area removal at interface level
Areas created via interface command are not being deleted when
executing the command `no ip ospf area x`

With the following configuration:
!
interface eth1
 ip address 10.0.12.2/24
 ip ospf area 0.0.0.100
!
router ospf
!

r2# sh ip ospf
 OSPF Routing Process, Router ID: 2.2.2.2
 Supports only single TOS (TOS0) routes
 ....
 Number of opaque AS LSA 0. Checksum Sum 0x00000000
 Number of areas attached to this router: 1     <--- ***
 Area ID: 0.0.0.100                             <--- ***
   Shortcutting mode: Default, S-bit consensus: ok
   Number of interfaces in this area: Total: 1, Active: 1
   Number of fully adjacent neighbors in this area: 0
   Area has no authentication
   Number of full virtual adjacencies going through this area: 0
   SPF algorithm executed 1 times
   Number of LSA 1
   Number of router LSA 1. Checksum Sum 0x0000f3d4
   Number of network LSA 0. Checksum Sum 0x00000000
   Number of summary LSA 0. Checksum Sum 0x00000000
   Number of ASBR summary LSA 0. Checksum Sum 0x00000000
   Number of NSSA LSA 0. Checksum Sum 0x00000000
   Number of opaque link LSA 0. Checksum Sum 0x00000000
   Number of opaque area LSA 0. Checksum Sum 0x00000000

However when removing the area from the interface, the command
above displays the same information

r2# conf t
r2(config)# int eth1
r2(config-if)# no ip ospf area 0.0.0.100
r2(config-if)# exit
r2(config)# exit

r2# sh ip ospf
 OSPF Routing Process, Router ID: 2.2.2.2
 Supports only single TOS (TOS0) routes
 ....
 Number of opaque AS LSA 0. Checksum Sum 0x00000000
 Number of areas attached to this router: 1       <--- ***
 Area ID: 0.0.0.100                               <--- ***
   Shortcutting mode: Default, S-bit consensus: ok
   Number of interfaces in this area: Total: 0, Active: 0
   Number of fully adjacent neighbors in this area: 0
   Area has no authentication
   Number of full virtual adjacencies going through this area: 0
   SPF algorithm executed 2 times
   Number of LSA 1
   Number of router LSA 1. Checksum Sum 0x0000e26e
   Number of network LSA 0. Checksum Sum 0x00000000
   Number of summary LSA 0. Checksum Sum 0x00000000
   Number of ASBR summary LSA 0. Checksum Sum 0x00000000
   Number of NSSA LSA 0. Checksum Sum 0x00000000
   Number of opaque link LSA 0. Checksum Sum 0x00000000
   Number of opaque area LSA 0. Checksum Sum 0x00000000

r2# sh run
!
interface eth1
 ip address 10.0.12.2/24
!
router ospf
!
end

This PR removes the area when executing `no ip ospf area` command

r2# sh ip ospf
 OSPF Routing Process, Router ID: 2.2.2.2
 Supports only single TOS (TOS0) routes
 ....
 Number of opaque AS LSA 0. Checksum Sum 0x00000000
 Number of areas attached to this router: 0

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-12-02 05:49:47 -08:00
Donald Sharp
16845ff4b0 tests: Wait for convergence first
The test_bgp_multi_vrf_topo2.py script had a bunch
of places where it would change an interface status
or add delete routes that would affect bgp convergence
but it was never ensuring that convergence had happened
before the test verified the bgp rib.  I believe this
was leading to many intermittant ci failures in
testing for other PR's to be accepted.  Modify
the code to wait for bgp convergence if we just
made a change to the topology

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-02 07:26:33 -05:00
Donald Sharp
2655301da7 ospfd: Set Curr_mtu to when we get the mtu
Currently if you start ospfd, bring up neighbors and then issue
a tcpdump on a interface ospf is peering over, this causes the neighbor
relationship to be restarted:

root@spectrum301(mlx-4600c-01):mgmt:~# tcpdump -i vlan402
2020-11-13T21:25:38.059671+00:00 spectrum301 ospfd[29953]: AdjChg: Nbr 202.0.0.3(default) on vlan402:200.0.3.1: Full -> Deleted (KillNbr)
2020-11-13T21:25:38.065520+00:00 spectrum301 ospfd[29953]: ospfTrapNbrStateChange: trap sent: 200.0.3.2 now Deleted/DROther
2020-11-13T21:25:38.065922+00:00 spectrum301 ospfd[29953]: ospfTrapIfStateChange: trap sent: 200.0.3.1 now Down
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vlan402, link-type EN10MB (Ethernet), capture size 262144 bytes
21:25:38.072330 IP 200.0.3.1 > igmp.mcast.net: igmp v3 report, 1 group record(s)
2020-11-13T21:25:38.080430+00:00 spectrum301 ospfd[29953]: ospfTrapIfStateChange: trap sent: 200.0.3.1 now Point-To-Point
2020-11-13T21:25:38.080654+00:00 spectrum301 ospfd[29953]: SPF Processing Time(usecs): 9734
2020-11-13T21:25:38.080829+00:00 spectrum301 ospfd[29953]:             SPF Time: 6422
2020-11-13T21:25:38.080991+00:00 spectrum301 ospfd[29953]:            InterArea: 1572
2020-11-13T21:25:38.081152+00:00 spectrum301 ospfd[29953]:                Prune: 67
2020-11-13T21:25:38.081329+00:00 spectrum301 ospfd[29953]:         RouteInstall: 1396
2020-11-13T21:25:38.081548+00:00 spectrum301 ospfd[29953]: Reason(s) for SPF: N, S, ABR, ASBR
21:25:38.092510 IP 200.0.3.1 > ospf-all.mcast.net: OSPFv2, Hello, length 44

This is happening because the curr_mtu is not being properly stored.  It was being set
on interface creation( but we have not actually read in the mtu part of the interface data, so
it is still 0 ).

Modify the code to store the curr_mtu at a point in interface creation *After* we have read
in interface data.

Ticket: CM-32276
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-02 06:55:31 -05:00
Donald Sharp
c9d9d82dd4
Merge pull request #7647 from ton31337/feature/show_best_path_reason_in_show_bgp
bgpd: Show best path reason in JSON output for `show bgp` command
2020-12-02 06:52:30 -05:00
Donald Sharp
c4ac61cef5
Merge pull request #7651 from idryzhov/ospf-init-instance
ospf: fix instance initialization when using multi-instance mode
2020-12-02 06:50:15 -05:00
Igor Ryzhov
c3391da1f0 ospf: fix instance initialization when using multi-instance mode
OSPF instance initialization was moved from "router ospf" vty command to
ospf_get function some time ago but the same thing must be done in
ospf_get_instance function used when multi-instance mode is enabled.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-12-02 03:38:07 +03:00
Quentin Young
c4db9bfaaf build: fix default scriptdir path
Should be /etc/frr/scripts, not /usr/lib/frr/scripts :)

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:42:24 -05:00
Quentin Young
0833300a7a doc: add scripting docs
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:42:17 -05:00
Quentin Young
b068d61304 lib: remove extraneous scripting debugs
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
bf6e726553 lib: use PREFIX_STRLEN in prefix encoder
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
e4e0229aba lib: add support for scripts directory
Specify default via --with-scriptdir at compile time, override default
with --scriptdir at runtime. If unspecified, it's {sysconfdir}/scripts
(usually /etc/frr/scripts)

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
fa22080d22 build: HAVE_LUA -> HAVE_SCRIPTING
And also guard all scripting-related stuff with HAVE_SCRIPTING.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
b4becb063f bgpd: update routemap scripting example
- Change from "match command <foo>" to "match script <script>"
- Use new scripting API

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
1a3a91e211 lib: use appropriate MTYPE for scripts
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
f869ab17a7 lib: add ability to decode from lua scripts
This implements the ability to get results out from lua scripts after
they've run.

For each C type we support passing to Lua, there is a corresponding
`struct frrscript_codec`. This struct contains a typename field - just a
string identifying the type - and two function pointers. The first
function pointer, encode, takes a lua_State and a pointer to the C value
and pushes some corresponding Lua representation onto the stack. The
second, decode, assumes there is some Lua value on the stack and decodes
it into the corresponding C value.

Each supported type's `struct frrscript_codec` is registered with the
scripting stuff in the library, which creates a mapping between the type
name (string) and the `struct frrscript_codec`. When calling a script,
you specify arguments by passing an array of `struct frrscript_env`.
Each of these structs has a void *, a type name, and a desired binding
name. The type names are used to look up the appropriate function to
encode the pointed-at value onto the Lua stack, then bind the pushed
value to the provided binding name, so that the converted value is
accessible by that name within the script.

Results work in a similar way. After a script runs, call
frrscript_get_result() with the script and a `struct frrscript_env`.
The typename and name fields are used to fetch the Lua value from the
script's environment and use the registered decoder for the typename to
convert the Lua value back into a C value, which is returned from the
function. The caller is responsible for freeing these.

frrscript_call()'s macro foo has been stripped, as the underlying
function now takes fixed arrays. varargs have awful performance
characteristics, they're hard to read, and structs are more defined than
an order sensitive list.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
eeb6172423 lib: add more type encoders, register existings
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
47dd873632 lib: change encoder_func signature
None of the core lua_push* functions return anything, and it helps to
not have to wrap those when using them as function pointers for our
encoder system, so change the type of our custom encoders to return void
as well.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
42ae55b5d4 lib: add more type encoder funcs
- in_addr
- in6_addr
- sockunion

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
9e47ee98a3 lib: cleanup / refactor scripting foo
- fix 'struct lua_State'
- change includes to library style
- rename encoder funcs to look like lua_push* funcs
- fix erroneous doc comment on prefix encoder
- remove unused (and broken) convenience func

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
224782816d lib: better load-time error handling for scripts
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
00d9e83a3f lib: encode plen when passing prefixes to scripts
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
479d37cce0 lib: close lua state when destroying script
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
646b0cce88 lib: add better script error handling
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
e613a6f73c lib: initialize scripting system in libfrr
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
12bf07a5dc lib: export zlog functions to scripts
Add:

- log.warn()
- log.error()
- log.notice()
- log.info()
- log.debug()

to the global namespace for each script

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00
Quentin Young
3b002f1916 lib: allow passing arguments to scripts
- Add ability to pass arguments when calling a script
- Add macros to define arguments and results

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-01 18:37:14 -05:00