]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 years agobgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()
Donatas Abraitis [Fri, 11 Jun 2021 06:17:05 +0000 (09:17 +0300)]
bgpd: Call bgp_dest_unlock_node() inside bgp_adj_in_remove()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8815 from idryzhov/fix-ospf-aggr
Donald Sharp [Wed, 9 Jun 2021 13:25:59 +0000 (09:25 -0400)]
Merge pull request #8815 from idryzhov/fix-ospf-aggr

ospfd: fix memory leaks in summarization

3 years agoMerge pull request #8808 from ton31337/feature/tracepoints_for_bgp_dest_lock_unlock
Donald Sharp [Wed, 9 Jun 2021 13:09:15 +0000 (09:09 -0400)]
Merge pull request #8808 from ton31337/feature/tracepoints_for_bgp_dest_lock_unlock

bgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node

3 years agoMerge pull request #8807 from mjstapp/fix_srv6_delete
Donald Sharp [Wed, 9 Jun 2021 13:07:53 +0000 (09:07 -0400)]
Merge pull request #8807 from mjstapp/fix_srv6_delete

lib,zebra: srv6 cleanup

3 years agoMerge pull request #8817 from donaldsharp/mlag_crash
Russ White [Wed, 9 Jun 2021 13:03:41 +0000 (09:03 -0400)]
Merge pull request #8817 from donaldsharp/mlag_crash

zebra: Give extra space and stop processing if we run out of space

3 years agozebra: Give extra space and stop processing if we run out of space
Donald Sharp [Tue, 8 Jun 2021 19:38:11 +0000 (15:38 -0400)]
zebra: Give extra space and stop processing if we run out of space

When processing bulk messages we need more space to handle more
mroutes.  In this case we are doubling the stream size from
16k -> 32k, which should roughly double the number of mroutes
we can handle in one go.

Additionally.   If we cannot parse the passed message into
the stream to pass up to pimd then gracefully stop processing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8798 from opensourcerouting/ospfd-fixes
Olivier Dugeon [Wed, 9 Jun 2021 07:06:42 +0000 (09:06 +0200)]
Merge pull request #8798 from opensourcerouting/ospfd-fixes

ospfd: assorted fixes

3 years agoMerge pull request #8593 from idryzhov/cmd-ambiguous
Quentin Young [Tue, 8 Jun 2021 15:41:45 +0000 (15:41 +0000)]
Merge pull request #8593 from idryzhov/cmd-ambiguous

vtysh: fix searching commands in parent nodes

3 years agoMerge pull request #8796 from idryzhov/ospf-passive
Russ White [Tue, 8 Jun 2021 15:24:30 +0000 (11:24 -0400)]
Merge pull request #8796 from idryzhov/ospf-passive

ospfd: fix passive interface configuration

3 years agoMerge pull request #7096 from gpnaveen/ospf_asbr_summarisation
Olivier Dugeon [Tue, 8 Jun 2021 15:20:33 +0000 (17:20 +0200)]
Merge pull request #7096 from gpnaveen/ospf_asbr_summarisation

tests : Adding 2 ospf asbr summary testcases.

3 years agoospfd: fix crash when displaying neighbor data in JSON
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when displaying neighbor data in JSON

Add a null check to protect against the case where the neighbor
inactive timer is disabled. That can happen when the router is
acting as a helper for another router that is attempting to restart
gracefully.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agolib, ospfd, ospf6d: fix logging of pointer addresses
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
lib, ospfd, ospf6d: fix logging of pointer addresses

The %p printf format specifier does already print the pointer address
with a leading "0x" prefix (indicating a hexadecimal number). There's
no need to add that prefix manually.

While here, replace explicit function names in log messages by
__func__.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix wrong NSSA debug guards
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix wrong NSSA debug guards

Fix usage of NSSA debug guards in code paths that have nothing to
do with NSSA areas.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agozebra, ospfd: fix typos in the graceful restart code
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
zebra, ospfd: fix typos in the graceful restart code

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix logging of what triggered the SPF run
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix logging of what triggered the SPF run

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix cleanup of MaxAge LSAs on exit
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix cleanup of MaxAge LSAs on exit

During shutdown, the ospf->maxage_lsa table is iterated over to
clean up all existing entries. While doing that, route_unlock_node()
should be called only for the nodes that have an associated entry,
otherwise the table will get corrupted and ospfd will crash.

As a side note, using a routing table to store MaxAge LSAs was a
very poor choice of a data structure, considering that a simple
rb-tree or hash table would get the job done with a much simpler
(and less error-prone) API. Something to cleanup in the future...

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix null pointer dereference when flushing an opaque LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix null pointer dereference when flushing an opaque LSA

Call ospf_lsa_flush() before free_opaque_info_per_id() since the
latter can deallocate the LSA that is going to be flushed.

Also, there's no need to set the LSA MaxAge to OSPF_LSA_MAXAGE
manually as the ospf_lsa_flush() function already takes care of that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix dangling pointer when exiting from the helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix dangling pointer when exiting from the helper mode

When exiting from the helper mode for a given router after an
unsuccessful graceful restart, removing the neighborship to that
router straight away leads to a dangling pointer in the associated
interface, which inevitably leads to a crash. To solve this
problem, schedule the removal of the neighbor instead of removing
it immediately.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix crash when logging a Grace-LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when logging a Grace-LSA

Change the "show_ospf_grace_lsa_info" callback to account for the
fact that the "vty" parameter can be null.

This fixes a crash that happens when "debug ospf packet ls-update
detail" is configured and a Grace-LSA is sent or received.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix small issue when exiting from the GR helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix small issue when exiting from the GR helper mode

When exiting from the GR helper mode, recalculate the DR only for
interfaces of the appropriate types (broadcast and NMBA).

This fixes a problem where the state of a neighbor reachable over a
p2p interface was changing from Full/DROther to Full/Backup across
a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix GR helper initialization and termination
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix GR helper initialization and termination

Since a single ospfd process can have multiple OSPF interfaces
configured, we need to separate the global GR initialization and
termination from per-instance initialization and termination.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #8727 from opensourcerouting/ospfv3-nssa
Russ White [Tue, 8 Jun 2021 14:24:29 +0000 (10:24 -0400)]
Merge pull request #8727 from opensourcerouting/ospfv3-nssa

ospf6d: implement NSSA area support

3 years agoospfd: fix memory leaks in summarization
Igor Ryzhov [Tue, 8 Jun 2021 14:01:56 +0000 (17:01 +0300)]
ospfd: fix memory leaks in summarization

To reproduce the issue:
1. Create summary-address: `summary-address 1.1.1.0/24`.
2. Try to delete it with the wrong tag: `no summary-address 1.1.1.0/24 tag 1`.
   Each time this command is executed, route_node_lookup is called which
   locks route node one more time. As the tag is wrong, the function
   return immediately without unlock.
3. Finally delete the summary-address: `no summary-address 1.1.1.0/24`.

The route node won't be deleted.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8713 from LabNConsulting/chopps/grpc-unit-test
Quentin Young [Tue, 8 Jun 2021 14:00:10 +0000 (14:00 +0000)]
Merge pull request #8713 from LabNConsulting/chopps/grpc-unit-test

3 years agoMerge pull request #8782 from LabNConsulting/chopps/timing-test
Rafael Zalamena [Tue, 8 Jun 2021 13:46:04 +0000 (10:46 -0300)]
Merge pull request #8782 from LabNConsulting/chopps/timing-test

tests: timing large config operations

3 years agoMerge pull request #8806 from donaldsharp/established
Sri Mohana Singamsetty [Mon, 7 Jun 2021 22:20:40 +0000 (15:20 -0700)]
Merge pull request #8806 from donaldsharp/established

bgpd: Convert to using peer_established(peer) function

3 years agotests: timing large config operations
Christian Hopps [Wed, 2 Jun 2021 22:32:37 +0000 (22:32 +0000)]
tests: timing large config operations

To start we use 10k static route config. This test goes along with
recent batching changes it will fail w/o them (b/c some operations w/o
batching take 100 times as long).

This test should be added to over time for other large config
items (e.g., acl, policy, etc)

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agobgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node
Donatas Abraitis [Mon, 7 Jun 2021 19:27:31 +0000 (22:27 +0300)]
bgpd: Add tracepoints for bgp_dest_lock_node/bgp_dest_unlock_node

static inline functions cannot be probed, let's add USDT.

This will help catching memory leaks regarding lock/unlock in the future,
I believe.

```
global locks;

probe begin
{
ansi_clear_screen();
println("Starting...");
}

probe process("/usr/lib/frr/bgpd").mark("bgp_dest_lock")
{
prefix = @cast($arg1, "bgp_node")->p->u->val;
locks[prefix]++;
printf("---> %s %d (lock count: %d)\n", probefunc(),
prefix, @cast($arg1, "bgp_node")->lock);
}

probe process("/usr/lib/frr/bgpd").mark("bgp_dest_unlock")
{

prefix = @cast($arg1, "bgp_node")->p->u->val;
if (locks[prefix] > 0) {
locks[prefix]--;
}
printf("<--- %s %d (lock count: %d)\n", probefunc(),
prefix, @cast($arg1, "bgp_node")->lock);
}
```

Some outputs:

```
<--- adj_free 94283113939304 (lock count: 2)
<--- adj_free 94283114099240 (lock count: 3)
<--- adj_free 94283114099752 (lock count: 3)
---> bgp_clear_route_table 94283113936008 (lock count: 4)
---> bgp_clear_route_table 94283113932664 (lock count: 4)
---> bgp_clear_route_table 94283114099240 (lock count: 3)
---> bgp_clear_route_table 94283114099752 (lock count: 3)
<--- adj_free 94283113795608 (lock count: 2)
<--- adj_free 94283113797112 (lock count: 2)
<--- adj_free 94283113796456 (lock count: 2)
---> bgp_clear_route_table 94283113936008 (lock count: 5)
---> bgp_clear_route_table 94283113932664 (lock count: 5)
---> bgp_clear_route_table 94283114099240 (lock count: 4)
---> bgp_clear_route_table 94283114099752 (lock count: 4)
---> bgp_process 94283113936008 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113936008 (lock count: 6)
---> bgp_process 94283113932664 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113932664 (lock count: 6)
---> bgp_process 94283114099240 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099240 (lock count: 5)
---> bgp_process 94283114099752 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099752 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113936008 (lock count: 5)
<--- bgp_clear_node_queue_del 94283113932664 (lock count: 5)
<--- bgp_clear_node_queue_del 94283114099240 (lock count: 4)
<--- bgp_clear_node_queue_del 94283114099752 (lock count: 4)
<--- bgp_path_info_reap 94283113936008 (lock count: 4)
<--- bgp_path_info_reap 94283113936008 (lock count: 3)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8805 from opensourcerouting/find-asan-crash
Igor Ryzhov [Mon, 7 Jun 2021 20:19:55 +0000 (23:19 +0300)]
Merge pull request #8805 from opensourcerouting/find-asan-crash

lib: fix address sanitizer crash on `find`

3 years agozebra: srv6 cleanup
Mark Stapp [Mon, 7 Jun 2021 18:26:25 +0000 (14:26 -0400)]
zebra: srv6 cleanup

Use NO_PROTO consistently in tests; make sure zapi client
instance and session are used for srv6 'chunks'.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: small srv6 text cleanup
Mark Stapp [Mon, 7 Jun 2021 18:25:46 +0000 (14:25 -0400)]
zebra: small srv6 text cleanup

Couple of small typos in srv6 zapi code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agobgpd: Convert to using peer_established(peer) function
Donald Sharp [Mon, 7 Jun 2021 13:39:10 +0000 (09:39 -0400)]
bgpd: Convert to using peer_established(peer) function

We are inconsistently using peer_establiahed(peer) with
sometimes using `peer->status == Established`.  Just Convert
over to using the function for consistency.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8789 from FRRouting/doctest
Donatas Abraitis [Mon, 7 Jun 2021 14:19:07 +0000 (17:19 +0300)]
Merge pull request #8789 from FRRouting/doctest

doc: bump sphinx version to 4.0.2, remove deprecated API

3 years agolib: fix address sanitizer crash on `find`
Rafael Zalamena [Mon, 7 Jun 2021 14:02:16 +0000 (11:02 -0300)]
lib: fix address sanitizer crash on `find`

Fix the following address sanitizer crash when running the command `find`:

  ERROR: AddressSanitizer: dynamic-stack-buffer-overflow
  WRITE of size 1 at 0x7fff4840fc1d thread T0
      0  in print_cmd ../lib/command.c:1541
      1  in cmd_find_cmds ../lib/command.c:2364
      2  in find ../vtysh/vtysh.c:3732
      3  in cmd_execute_command_real ../lib/command.c:995
      4  in cmd_execute_command ../lib/command.c:1055
      5  in cmd_execute ../lib/command.c:1219
      6  in vtysh_execute_func ../vtysh/vtysh.c:486
      7  in vtysh_execute ../vtysh/vtysh.c:671
      8  in main ../vtysh/vtysh_main.c:721
      9  in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
      10 in _start (/usr/bin/vtysh+0x21f64d)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: add dtor for srv6 locator chunk list
Mark Stapp [Fri, 4 Jun 2021 18:57:42 +0000 (14:57 -0400)]
lib: add dtor for srv6 locator chunk list

Add a delete function for the chunk list in an srv6
locator.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #8778 from idryzhov/fix-zebra-vrf
Rafael Zalamena [Mon, 7 Jun 2021 11:59:10 +0000 (08:59 -0300)]
Merge pull request #8778 from idryzhov/fix-zebra-vrf

zebra: fix config after exit from vrf

3 years agoMerge pull request #8758 from idryzhov/bfd-fixes
Rafael Zalamena [Mon, 7 Jun 2021 11:34:06 +0000 (08:34 -0300)]
Merge pull request #8758 from idryzhov/bfd-fixes

BFD fixes

3 years agoMerge pull request #8781 from idryzhov/fix-list-find
Rafael Zalamena [Mon, 7 Jun 2021 11:32:31 +0000 (08:32 -0300)]
Merge pull request #8781 from idryzhov/fix-list-find

lib: fix output of "list" and "find" commands

3 years agoMerge pull request #8756 from volta-networks/ospfd_sr_blocks
Olivier Dugeon [Mon, 7 Jun 2021 09:15:03 +0000 (11:15 +0200)]
Merge pull request #8756 from volta-networks/ospfd_sr_blocks

ospfd, doc: combined SRGB/SRLB command

3 years agoMerge pull request #8801 from donaldsharp/SR_coverity
Donatas Abraitis [Mon, 7 Jun 2021 06:52:08 +0000 (09:52 +0300)]
Merge pull request #8801 from donaldsharp/SR_coverity

Sr coverity

3 years agotests: add grpc unit test
Christian Hopps [Thu, 20 May 2021 23:22:14 +0000 (19:22 -0400)]
tests: add grpc unit test

Test uses staticd which required some C++ header protections.
Additionally, the test also runs in the ubuntu20 docker container as
grpc is supported there by the packaging system.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agobgpd: bgp_vrf has already been derefed in all paths
Donald Sharp [Sat, 5 Jun 2021 16:57:55 +0000 (12:57 -0400)]
bgpd: bgp_vrf has already been derefed in all paths

Coverity scan found this issue.  The bgp_vrf variable in
ensure_vrf_tovpn_sid() has already been derefed in all paths
at this point in time.  No need to check for it existing
at this point.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopathd: Remove unused function
Donald Sharp [Sat, 5 Jun 2021 16:55:48 +0000 (12:55 -0400)]
pathd: Remove unused function

format_yang_dnode is never used and it has coverity issues, removing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: replace "passive-interface IFNAME" with "ip ospf passive"
Igor Ryzhov [Sat, 5 Jun 2021 14:53:23 +0000 (17:53 +0300)]
doc: replace "passive-interface IFNAME" with "ip ospf passive"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd: fix passive interface configuration
Igor Ryzhov [Fri, 4 Jun 2021 14:47:32 +0000 (17:47 +0300)]
ospfd: fix passive interface configuration

Currently, passive interface flag is configured from the router node
using "passive-interface IFNAME". There are multiple problems with this
command:
- it is not in line with all other interface-related commands - other
  parameters are configured from the interface node using "ip ospf"
  prefix
- it is not in line with OSPFv3 - passive flag is configured from the
  interface node using "ipv6 ospf6 passive" command
- most importantly, it doesn't work correctly when the interface is in
  a different VRF - when using VRF-lite, it incorrectly changes the
  vrf_id of the interface and it becomes desynced with the actual state;
  when using netns, it creates a new fake interface and configures it
  instead of configuring the necessary interface

To fix all the problems, this commit adds a new command to the interface
configuration node - "ip ospf passive". The purpose of the command is
completely the same, but it works correctly in a multi-VRF environment.

The old command is preserved for the backward compatibility, but the
warning is added that it is deprecated because it doesn't work correctly
with VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8706 from LabNConsulting/chopps/fix-grpc-threading
Quentin Young [Fri, 4 Jun 2021 20:31:34 +0000 (20:31 +0000)]
Merge pull request #8706 from LabNConsulting/chopps/fix-grpc-threading

3 years agoMerge pull request #5865 from slankdev/slankdev-zebra-srv6-manager
Mark Stapp [Fri, 4 Jun 2021 17:41:55 +0000 (13:41 -0400)]
Merge pull request #5865 from slankdev/slankdev-zebra-srv6-manager

zebra: srv6 manager

3 years agozebra: fix config after exit from vrf
Igor Ryzhov [Wed, 2 Jun 2021 14:27:02 +0000 (17:27 +0300)]
zebra: fix config after exit from vrf

When the VRF node is exited using "exit" or "quit", there's still a VRF
pointer stored in the vty context. If you try to configure some router
related command, it will be applied to the previous VRF instead of the
default VRF. For example:

```
(config)# vrf test
(config-vrf)# ip router-id 1.1.1.1
(config-vrf)# do show run
...
!
vrf test
 ip router-id 1.1.1.1
 exit-vrf
!
...
(config-vrf)# exit
(config)# ip router-id 2.2.2.2
(config)# do show run
...
!
vrf test
 ip router-id 2.2.2.2
 exit-vrf
!
...
```

`vrf-exit` works correctly, because it stores a pointer to the default
VRF into the vty context (but weirdly keeping the VRF_NODE instead of
changing it to CONFIG_NODE).

Instead of relying on the behavior of exit function, always use the
default VRF when in CONFIG_NODE.

Another problem is missing `VTY_CHECK_CONTEXT`. If someone deletes the
VRF in which node the user enters the command, then zebra applies the
command to the default VRF instead of throwing an error.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd, doc, tests: combined SRGB/SRLB command
Emanuele Di Pascale [Thu, 27 May 2021 12:37:48 +0000 (14:37 +0200)]
ospfd, doc, tests: combined SRGB/SRLB command

similarly to what was done for IS-IS in commit 01d43141, combine
the SRGB and SRLB commands for OSPF-SR, so that we can replace
overlapping ranges in one sweep change.

Also allow the range configuration to be stored before SR is enabled.
There is no reason why we should not - in fact that constraint meant
that we were always requesting the default label ranges regardless
of what we actually wanted to use.

Finally, update the topotests now that we do not need to refresh
the SRGB/SRLB/MSD after disabling SR. Note that the prefix-sid still
needs to be re-added.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoMerge pull request #8779 from idryzhov/zebra-rst
Mark Stapp [Fri, 4 Jun 2021 14:38:09 +0000 (10:38 -0400)]
Merge pull request #8779 from idryzhov/zebra-rst

Zebra doc fixes

3 years agoMerge pull request #8772 from idryzhov/bfd-key-packed
Rafael Zalamena [Fri, 4 Jun 2021 13:42:21 +0000 (10:42 -0300)]
Merge pull request #8772 from idryzhov/bfd-key-packed

bfdd: fix bfd key structure

3 years agoMerge pull request #8783 from idryzhov/doc-varname
Donatas Abraitis [Fri, 4 Jun 2021 12:32:10 +0000 (15:32 +0300)]
Merge pull request #8783 from idryzhov/doc-varname

doc: remove varnames from command descriptions

3 years agotopotests: OSPFv3 NSSA test LSA type 7
Rafael Zalamena [Sun, 30 May 2021 15:49:19 +0000 (12:49 -0300)]
topotests: OSPFv3 NSSA test LSA type 7

New OSPFv3 NSSA test:
 * When a static route is redistributed to an NSSA router it should be
   type 7 and should show up in OSPFv3 route database.
 * Test LSA Type 7 and route removal.

Co-authored-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: add tests for OSPFv3 NSSA/Stub
Kaushik [Thu, 25 Mar 2021 11:43:15 +0000 (04:43 -0700)]
topotests: add tests for OSPFv3 NSSA/Stub

New test verification:
 * Stub and NSSA areas contain no external routes

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: missing NSSA areas handling
Rafael Zalamena [Sun, 30 May 2021 13:46:06 +0000 (10:46 -0300)]
ospf6d: missing NSSA areas handling

Patch provided by Soman K.S. with small alterations.

Signed-off-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: OSPFv3 NSSA command document
Kaushik [Thu, 25 Mar 2021 11:38:54 +0000 (04:38 -0700)]
doc: OSPFv3 NSSA command document

Document added for ospfv3 nssa command.

Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoospf6d: support for nssa in ospfv3
Kaushik [Thu, 25 Mar 2021 15:43:26 +0000 (08:43 -0700)]
ospf6d: support for nssa in ospfv3

Fix for the routes which is not classified as best routes.

Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoospf6d: Support for nssa in ospfv3
Kaushik [Thu, 25 Mar 2021 11:29:51 +0000 (04:29 -0700)]
ospf6d: Support for nssa in ospfv3

The following is implemented.
1. Configuring area as NSSA.
2. Generating Type 7 LSA.
3. Conversion of Type 7 to Type 5 ( Default Behavior).
4. NSSA ABR selection.

Reviewed-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Co-authored-by: Kaushik <kaushiknath.null@gmail.com>
Co-authored-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoMerge pull request #8776 from anlancs/fix-ospf-cli-passive-interface
Igor Ryzhov [Fri, 4 Jun 2021 08:06:51 +0000 (11:06 +0300)]
Merge pull request #8776 from anlancs/fix-ospf-cli-passive-interface

ospfd: remove ospf interface config: passive-interface

3 years agodoc: use add_css_file(); not deprecated
Quentin Young [Thu, 3 Jun 2021 17:41:13 +0000 (13:41 -0400)]
doc: use add_css_file(); not deprecated

add_stylesheet() is deprecated and removed in Sphinx 4.x

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: add requirements.txt
Quentin Young [Thu, 3 Jun 2021 17:35:34 +0000 (13:35 -0400)]
doc: add requirements.txt

Add a minimum sphinx version requirement for the docs; RTD needs this to
know what version of sphinx to install.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8771 from volta-networks/fix_pathd_bandwidth
Renato Westphal [Thu, 3 Jun 2021 14:33:56 +0000 (11:33 -0300)]
Merge pull request #8771 from volta-networks/fix_pathd_bandwidth

pathd: fix render candidate-path bandwidth

3 years agoospfd: if destroy the whole ospf, then remove ospf's interface config: passive-interface
anlancs [Wed, 2 Jun 2021 02:51:49 +0000 (10:51 +0800)]
ospfd: if destroy the whole ospf, then remove ospf's interface config: passive-interface

Signed-off-by: anlancs <anlan_cs@tom.com>
3 years agodoc: remove varnames from command descriptions
Igor Ryzhov [Wed, 2 Jun 2021 23:19:36 +0000 (02:19 +0300)]
doc: remove varnames from command descriptions

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix output of "list" and "find" commands
Igor Ryzhov [Wed, 2 Jun 2021 23:02:45 +0000 (02:02 +0300)]
lib: fix output of "list" and "find" commands

Currently, we output the command exactly how it is defined in DEFUN.
We shouldn't output varnames and excessive whitespace.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib, vtysh: reduce code duplication
Igor Ryzhov [Wed, 2 Jun 2021 21:29:51 +0000 (00:29 +0300)]
lib, vtysh: reduce code duplication

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8210 from LabNConsulting/chopps/always-batch
Donald Sharp [Wed, 2 Jun 2021 22:13:42 +0000 (18:13 -0400)]
Merge pull request #8210 from LabNConsulting/chopps/always-batch

northbound: KISS always batch yang config, it's faster.

3 years agobfdd: fix bfd key structure
Igor Ryzhov [Tue, 1 Jun 2021 17:30:13 +0000 (20:30 +0300)]
bfdd: fix bfd key structure

There's a padding byte between "mhop" and "peer" fields in this structure.
This structure is sometimes passed by value to functions and used in
assignments. The standard doesn't guarantee that the padding bytes are
copied on assignments. As this structure is used as a hash key, having
this padding byte with unspecified value can lead to unwanted behavior.

Fix the possible issue by making the "mhop" field to be 2 bytes. Also
make the struct packed as a precaution for future changes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: add separate section for nexthop tracking
Igor Ryzhov [Wed, 2 Jun 2021 14:51:09 +0000 (17:51 +0300)]
doc: add separate section for nexthop tracking

"ip nht resolve-via-default" is currently placed in "Link Parameters
Commands" section. Add a separate section and missing IPv6 counterpart.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: fix link-params commands
Igor Ryzhov [Wed, 2 Jun 2021 14:39:26 +0000 (17:39 +0300)]
doc: fix link-params commands

Remove redundant prefix.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd,sharpd,zebra: fix code style
Hiroki Shirokura [Wed, 5 May 2021 10:37:55 +0000 (10:37 +0000)]
bgpd,sharpd,zebra: fix code style

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*
Hiroki Shirokura [Fri, 23 Apr 2021 12:46:07 +0000 (12:46 +0000)]
*: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*

https://github.com/FRRouting/frr/pull/5865#discussion_r597670225

As this comment says. ZEBRA_FLAG_XXX should not have been used.
To communicate SRv6 Route Information. A simple Nexthop Flag would
have been sufficient for SRv6 information. And I fixed the whole
thing that way.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: early return on seg6local nlmsg crafting
Hiroki Shirokura [Fri, 23 Apr 2021 11:27:41 +0000 (11:27 +0000)]
zebra: early return on seg6local nlmsg crafting

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib,sharpd,zebra: update nexthop object with nh_srv6
Hiroki Shirokura [Mon, 5 Apr 2021 13:29:12 +0000 (13:29 +0000)]
lib,sharpd,zebra: update nexthop object with nh_srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agodoc: update srv6 cli guide
Hiroki Shirokura [Sat, 3 Apr 2021 17:33:06 +0000 (17:33 +0000)]
doc: update srv6 cli guide

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agotests: update sharpd srv6 route command
Hiroki Shirokura [Fri, 2 Apr 2021 12:12:46 +0000 (12:12 +0000)]
tests: update sharpd srv6 route command

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agosharpd: split srv6 route install command
Hiroki Shirokura [Fri, 2 Apr 2021 12:12:20 +0000 (12:12 +0000)]
sharpd: split srv6 route install command

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fill_seg6ipt_encap func with boundary check
Hiroki Shirokura [Mon, 22 Mar 2021 13:58:20 +0000 (13:58 +0000)]
zebra: fill_seg6ipt_encap func with boundary check

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agosharpd: follow the practice on cli design for json output
Hiroki Shirokura [Mon, 22 Mar 2021 11:32:09 +0000 (11:32 +0000)]
sharpd: follow the practice on cli design for json output

The "show sharp segment-routing srv6" command was a
json output command, but it did not follow the common
practice of the other commands.

It follows the review and outputs the json format by
using the json keyword. Otherwise, it produces human
readable output.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: error check for nl_attr_xxx
Hiroki Shirokura [Mon, 22 Mar 2021 10:36:17 +0000 (10:36 +0000)]
zebra: error check for nl_attr_xxx

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: use const on fill_seg6ipt_encap func
Hiroki Shirokura [Mon, 22 Mar 2021 09:48:04 +0000 (09:48 +0000)]
zebra: use const on fill_seg6ipt_encap func

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix implicit conversion
Hiroki Shirokura [Mon, 22 Mar 2021 09:28:32 +0000 (09:28 +0000)]
zebra: fix implicit conversion

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: eliminate redundant info from srv6 locator zapi
Hiroki Shirokura [Mon, 22 Mar 2021 09:07:18 +0000 (09:07 +0000)]
*: eliminate redundant info from srv6 locator zapi

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agotests: fix json style on srv6_locator test
Hiroki Shirokura [Mon, 22 Mar 2021 08:23:08 +0000 (08:23 +0000)]
tests: fix json style on srv6_locator test

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: drop un-needed info in locator-zapi
Hiroki Shirokura [Mon, 22 Mar 2021 02:24:06 +0000 (02:24 +0000)]
zebra: drop un-needed info in locator-zapi

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: delete unneeded zebra_srv6_manager_connect
Hiroki Shirokura [Mon, 22 Mar 2021 01:45:33 +0000 (01:45 +0000)]
zebra: delete unneeded zebra_srv6_manager_connect

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: erase wrong comments by copy-paste
Hiroki Shirokura [Mon, 22 Mar 2021 01:09:16 +0000 (01:09 +0000)]
lib: erase wrong comments by copy-paste

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: eliminate odd line-break
Hiroki Shirokura [Mon, 22 Mar 2021 00:57:03 +0000 (00:57 +0000)]
lib: eliminate odd line-break

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: integrate srv6-nexthop-cmp functions
Hiroki Shirokura [Mon, 22 Mar 2021 00:52:11 +0000 (00:52 +0000)]
lib: integrate srv6-nexthop-cmp functions

I agree with the PR review from mstap and merged
the following two functions into one.

- zapi_nexthop_seg6_cmp
- zapi_nexthop_seg6local_cmp

[note]
If both of them have more complex extensions in the future,
I think it will be less confusing to remove the integration
of these functions and make them as separate functions as
before.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: use one line init instead of memset and format it
Hiroki Shirokura [Mon, 22 Mar 2021 00:31:56 +0000 (00:31 +0000)]
*: use one line init instead of memset and format it

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: fix json style to camel-case instead of underscores
Hiroki Shirokura [Mon, 22 Mar 2021 00:04:06 +0000 (00:04 +0000)]
lib: fix json style to camel-case instead of underscores

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix typo
Hiroki Shirokura [Mon, 8 Mar 2021 15:05:49 +0000 (15:05 +0000)]
zebra: fix typo

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix build error for NetBSD8
Hiroki Shirokura [Wed, 24 Feb 2021 11:52:30 +0000 (11:52 +0000)]
bgpd: fix build error for NetBSD8

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix Dereference of null pointer
Hiroki Shirokura [Wed, 24 Feb 2021 11:28:59 +0000 (11:28 +0000)]
zebra: fix Dereference of null pointer

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: fix code format accourding to checkpatch
Hiroki Shirokura [Wed, 24 Feb 2021 09:36:09 +0000 (09:36 +0000)]
*: fix code format accourding to checkpatch

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: ignore nexthop validation for srv6-vpn
Hiroki Shirokura [Tue, 9 Feb 2021 05:26:22 +0000 (05:26 +0000)]
bgpd: ignore nexthop validation for srv6-vpn

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: use zapi_srv6_locator_chunk_decode
Hiroki Shirokura [Thu, 31 Dec 2020 11:57:03 +0000 (11:57 +0000)]
bgpd: use zapi_srv6_locator_chunk_decode

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: add zapi_srv6_locator_chunk_{en,de}code
Hiroki Shirokura [Thu, 31 Dec 2020 11:56:32 +0000 (11:56 +0000)]
zebra: add zapi_srv6_locator_chunk_{en,de}code

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agodoc: fix srv6 section according to review
Hiroki Shirokura [Wed, 30 Dec 2020 02:16:44 +0000 (02:16 +0000)]
doc: fix srv6 section according to review

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix vrf route-leaking crash around srv6
Hiroki Shirokura [Wed, 30 Dec 2020 01:19:20 +0000 (01:19 +0000)]
bgpd: fix vrf route-leaking crash around srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>