]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #8831 from sworleys/Fix-No-Ospf-Func
Igor Ryzhov [Fri, 11 Jun 2021 08:33:13 +0000 (11:33 +0300)]
Merge pull request #8831 from sworleys/Fix-No-Ospf-Func

ospf6d: fix undefined function

3 years agoospf6d: fix undefined function
Stephen Worley [Thu, 10 Jun 2021 21:39:56 +0000 (17:39 -0400)]
ospf6d: fix undefined function

Some wires got crossed during a couple merges using/changing
this function.

Update it to its new name.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agoMerge pull request #8823 from donaldsharp/ospfv3_coverity
Rafael Zalamena [Thu, 10 Jun 2021 18:13:11 +0000 (15:13 -0300)]
Merge pull request #8823 from donaldsharp/ospfv3_coverity

Ospfv3 coverity

3 years agoMerge pull request #8691 from louis-oui/split-soft-reconfig
Donald Sharp [Thu, 10 Jun 2021 16:04:54 +0000 (12:04 -0400)]
Merge pull request #8691 from louis-oui/split-soft-reconfig

bgpd: split soft reconfig table task into several jobs to not block vtysh

3 years agoMerge pull request #8561 from opensourcerouting/msdp-refactor-v2
Donald Sharp [Thu, 10 Jun 2021 13:44:28 +0000 (09:44 -0400)]
Merge pull request #8561 from opensourcerouting/msdp-refactor-v2

pimd: rework MSDP mesh groups

3 years agoMerge pull request #8733 from idryzhov/ipv6-ospf6-area
Rafael Zalamena [Thu, 10 Jun 2021 13:34:45 +0000 (10:34 -0300)]
Merge pull request #8733 from idryzhov/ipv6-ospf6-area

ospf6d: fix interface area configuration

3 years agoospf6d: Rename ospf6_is_router_abr to more accurately reflect what it does
Donald Sharp [Thu, 10 Jun 2021 11:59:06 +0000 (07:59 -0400)]
ospf6d: Rename ospf6_is_router_abr to more accurately reflect what it does

The ospf6_is_router_abr is checking to see if ospfv3 is an abr router
and also setting values.  Let's rename it too `ospf6_check_and_set_router_abr`
to more accurately reflect what it is doing.

Additionally fix coverity #1505176 where we were not checking the return
value of ospf6_is_router_abr like we did every other time.  In this
case we don't care about the return value so indicate that we do not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Fix coverity Possible null deref
Donald Sharp [Thu, 10 Jun 2021 11:46:36 +0000 (07:46 -0400)]
ospf6d: Fix coverity Possible null deref

There exists a code path where ospf6 could be NULL and passing
to a function where it would always be derefed is a bad idea.

Put some small code in place to prevent this and allow this to be debuged
if it happens in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8754 from louis-oui/bgp-summary-filter
Donatas Abraitis [Thu, 10 Jun 2021 06:58:31 +0000 (09:58 +0300)]
Merge pull request #8754 from louis-oui/bgp-summary-filter

bgpd: improve show bgp summary display

3 years agopimd: rename some MSDP functions
Rafael Zalamena [Wed, 9 Jun 2021 15:40:04 +0000 (12:40 -0300)]
pimd: rename some MSDP functions

Rename and shorten function names to make them uniform.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: new test topology for MSDP
Rafael Zalamena [Tue, 20 Apr 2021 17:54:27 +0000 (14:54 -0300)]
topotests: new test topology for MSDP

Add basic topology test for MSDP meshed groups.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: support adding hosts
Rafael Zalamena [Tue, 20 Apr 2021 17:54:20 +0000 (14:54 -0300)]
topotests: support adding hosts

Add API to topogen so we can build topology with simple hosts instead
of routers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: rework MSDP mesh-group code
Rafael Zalamena [Tue, 20 Apr 2021 17:54:09 +0000 (14:54 -0300)]
pimd: rework MSDP mesh-group code

Fully utilize the northbound to hold pointers to our private data
instead of searching for data structures every time we need to change a
configuration.

Highlights:

 * Support multiple mesh groups per PIM instance (instead of one)
 * Use DEFPY instead of DEFUN to reduce code complexity
 * Use northbound private pointers to store data structures
 * Reduce callback names size

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoyang: rework PIM MSDP mesh group
Rafael Zalamena [Tue, 20 Apr 2021 17:54:01 +0000 (14:54 -0300)]
yang: rework PIM MSDP mesh group

Allow PIM MSDP configuration to support multiple MSDP mesh groups per
PIM instance.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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 agotests: replace "interface IFNAME area" with "ipv6 ospf6 area"
Igor Ryzhov [Mon, 7 Jun 2021 19:58:30 +0000 (22:58 +0300)]
tests: replace "interface IFNAME area" with "ipv6 ospf6 area"

Only one test is modified yet, to have both new and deprecated commands
tested by the CI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: replace "interface IFNAME area" with "ipv6 ospf6 area"
Igor Ryzhov [Tue, 25 May 2021 23:05:11 +0000 (02:05 +0300)]
doc: replace "interface IFNAME area" with "ipv6 ospf6 area"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: fix interface area configuration
Igor Ryzhov [Tue, 25 May 2021 22:49:30 +0000 (01:49 +0300)]
ospf6d: fix interface area configuration

Currently the interface area is configured from the router node using
"interface IFNAME area ID" command. 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 "ipv6 ospf6"
  prefix
- it is not in line with OSPFv2 - area is configured from the interface
  node using "ip ospf area" command
- most importantly, it doesn't work correctly when the interface is in
  a different VRF - instead of configuring the interface, it creates a
  new fake interface and configuring it instead

To fix all the problems, this commit adds a new command to the interface
configuration node - "ipv6 ospf6 area ID". 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 agotests: fix ospf6_topo1_vrf
Igor Ryzhov [Mon, 7 Jun 2021 18:58:26 +0000 (21:58 +0300)]
tests: fix ospf6_topo1_vrf

ospf6d (and all other daemons except zebra) doesn't correctly process
`interface X vrf Y`, because it doesn't know existing VRFs at the time
of configuration file reading. Therefore it doesn't apply configuration
provided in the interface node.

Fix the problem by removing `vrf Y` part, having just an interface name
is enough.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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 agobgpd: add terse display option on show bgp summary
Louis Scalbert [Wed, 12 May 2021 16:54:11 +0000 (18:54 +0200)]
bgpd: add terse display option on show bgp summary

Add a terse option to show bgp summary to shorten output.

Do not show the following information about the BGP
instances: the number of RIB entries, the table version and the used memory.
The "terse" option can be used in combination with the "remote-as", "neighbor",
"failed" and "established" filters, and with the "wide" option as well.

Before patch:

ubuntu# show bgp summary remote-as 123456
IPv4 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0
BGP table version 0
RIB entries 3, using 552 bytes of memory
Peers 5, using 3635 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
10.200.200.2    4     123456     81432         4        0 56092    0 00:00:13       572106        0 N/A

Displayed neighbors 1
Total number of neighbors 4

IPv6 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0
BGP table version 0
RIB entries 3, using 552 bytes of memory
Peers 5, using 3635 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
% No matching neighbor

Total number of neighbors 5

After patch:

ubuntu# show bgp summary remote-as 123456 terse
IPv4 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 0

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
10.200.200.2    4     123456     81432         4        0 56092    0 00:00:13       572106        0 N/A

Displayed neighbors 1
Total number of neighbors 4

IPv6 Unicast Summary (VRF default):
BGP router identifier X.X.X.X, local AS number XXX vrf-id 1

% No matching neighbor

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agobgpd: add counter of displayed show bgp summary when filtering
Louis Scalbert [Wed, 12 May 2021 15:40:03 +0000 (17:40 +0200)]
bgpd: add counter of displayed show bgp summary when filtering

When filtering sessions on show bgp summary with failed, established,
neighbor and remote-as options, add a counter of displayed neighbors
in addition to the total number of neighbor :

"Displayed neighbors X"

ubuntu# show bgp summary failed remote-as external
IPv4 Unicast Summary (VRF default):

Neighbor        EstdCnt DropCnt ResetTime Reason
10.200.200.2          0       0     never Waiting for NHT
172.16.29.2           0       0     never Waiting for NHT
10.22.1.2             0       0     never Waiting for NHT

Displayed neighbors 3
Total number of neighbors 5

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agobgpd: display pretty VRF/view name on no such neighbor
Louis Scalbert [Wed, 12 May 2021 13:49:40 +0000 (15:49 +0200)]
bgpd: display pretty VRF/view name on no such neighbor

Display on which VRF/view the neighbor was not found. Useful when
selecting "vrf all".

Before patch:
No such neighbor in this view/vrf

After patch:
No such neighbor in VRF default

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
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 agobgpd: split soft reconfigure table task into several jobs to not block vtysh
Louis Scalbert [Wed, 4 Nov 2020 14:35:47 +0000 (15:35 +0100)]
bgpd: split soft reconfigure table task into several jobs to not block vtysh

BGP configuration changes that imply recomputing the BGP route table
(e.g. modifying route-maps, setting bgp graceful-shutdown) might be a
long time process depending on the size of the BGP table and the
route-map numbers and complexity. For example, setups with full
Internet routes take something like one minute to reprocess all the
prefixes when graceful-shutdown is configured. During this time, a
"show bgp commands" request on vtysh results in blocking the shell until
the soft reconfigure table task is over.

This patch splits bgp_soft_reconfig_table task into thread jobs of 25K
prefixes.

Some tests on a full Internet route setup show that after reconfiguring
route-maps or graceful-shutdown, vtysh is not stucked anymore. We are
now able to request commands like "show bgp summary" after 1 or 2
seconds instead of 30 to 60s.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
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 agobgpd: modify VRF/view display in show bgp summary
Louis Scalbert [Wed, 12 May 2021 13:47:21 +0000 (15:47 +0200)]
bgpd: modify VRF/view display in show bgp summary

Modify VRF/view display in show bgp summary:
- to be more concise
- to display on which VRF/view no neighbor was found

Before patch:
ubuntu# show bgp vrf all summary

Instance default:

IPv4 Unicast Summary:
BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0
(...)
IPv6 Unicast Summary:

Instance private:

IPv4 Unicast Summary:

ubuntu# show bgp vrf all ipv4 multicast summary
% No BGP neighbors found
% No BGP neighbors found

After patch:
ubuntu# show bgp vrf all summary

IPv4 Unicast Summary (VRF default):
BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0
(...)
IPv6 Unicast Summary (VRF default):
(...)
IPv4 Unicast Summary (VRF private):
(...)

ubuntu# show bgp vrf all ipv4 multicast summary
% No BGP neighbors found in VRF default
% No BGP neighbors found in VRF private

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agotopotests: remove uneccessary vtysh cmd request
Louis Scalbert [Thu, 27 May 2021 15:43:18 +0000 (17:43 +0200)]
topotests: remove uneccessary vtysh cmd request

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
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>