]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agozebra: Add support for json output in srv6 locator detail command
Yamato Sugawara [Tue, 26 Oct 2021 12:21:20 +0000 (12:21 +0000)]
zebra: Add support for json output in srv6 locator detail command

Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2 years agoMerge pull request #10134 from donaldsharp/isis_topo1_vrf_fix
Donatas Abraitis [Sat, 27 Nov 2021 22:13:30 +0000 (23:13 +0100)]
Merge pull request #10134 from donaldsharp/isis_topo1_vrf_fix

tests: Fix isis_topo1_vrf to wait a tiny bit for zebra route install

2 years agotests: Fix isis_topo1_vrf to wait a tiny bit for zebra route install
Donald Sharp [Sat, 27 Nov 2021 18:12:50 +0000 (13:12 -0500)]
tests: Fix isis_topo1_vrf to wait a tiny bit for zebra route install

During repeated runs I am seeing this test fail to run successfully.
Upon inspecting the output:
            {
              "prefix":"10.0.10.0/24",
              "prefixLen":24,
              "protocol":"isis",
              "vrfId":6,
              "vrfName":"r1-cust1",
              "selected":true,
              "destSelected":true,
              "distance":115,
              "metric":10,
              "queued":true,

We can see that the route is still queued.  Under heavy system
load and not ensuring that isis has time to send the route to
zebra and for zebra to install the route, this test can fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9203 from opensourcerouting/bgpd-show-json
Russ White [Sat, 27 Nov 2021 13:30:04 +0000 (08:30 -0500)]
Merge pull request #9203 from opensourcerouting/bgpd-show-json

bgpd: add "json" option to a few more show commands

2 years agoMerge pull request #10127 from idryzhov/ospf-asbr-instance
Donatas Abraitis [Sat, 27 Nov 2021 09:20:02 +0000 (10:20 +0100)]
Merge pull request #10127 from idryzhov/ospf-asbr-instance

ospfd: fix summary-address deletion

2 years agoMerge pull request #10106 from ton31337/fix/missing_llgr_cap_handling
Igor Ryzhov [Fri, 26 Nov 2021 15:42:32 +0000 (18:42 +0300)]
Merge pull request #10106 from ton31337/fix/missing_llgr_cap_handling

bgpd: Add missing LLGR capability handling stuff

2 years agoMerge pull request #10126 from SaiGomathiN/cleanup
Igor Ryzhov [Fri, 26 Nov 2021 14:24:38 +0000 (17:24 +0300)]
Merge pull request #10126 from SaiGomathiN/cleanup

pimd: removing no caller functions

2 years agoMerge pull request #10125 from ton31337/feature/replace_prefix_to_json_object_string_addf
Igor Ryzhov [Fri, 26 Nov 2021 14:23:45 +0000 (17:23 +0300)]
Merge pull request #10125 from ton31337/feature/replace_prefix_to_json_object_string_addf

*: Replace prefix2str for JSON to %pFX

2 years agopimd: removing no caller functions
Sai Gomathi [Thu, 25 Nov 2021 16:08:09 +0000 (08:08 -0800)]
pimd: removing no caller functions

Removing the no caller function declarations and definitions
in pimd directory.

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2 years agoospfd: fix summary-address deletion
Igor Ryzhov [Thu, 25 Nov 2021 18:17:58 +0000 (21:17 +0300)]
ospfd: fix summary-address deletion

When the summary-address is deleted, `ospf_aggr_handle_external_info` is
called for each aggregated route for the cleanup. It needs to find the
corresponding OSPF instance and it does it using the `ei->instance`
which is totally wrong, because it's the instance from which the route
is redistributed, not the local OSPF instance. A pointer to the correct
OSPF instance is already stored in the external_info structure.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years ago*: Remove unused variables
Donatas Abraitis [Thu, 25 Nov 2021 15:35:55 +0000 (17:35 +0200)]
*: Remove unused variables

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:31:25 +0000 (17:31 +0200)]
bgpd: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agolib: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:30:36 +0000 (17:30 +0200)]
lib: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:29:30 +0000 (17:29 +0200)]
ospfd: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopbrd: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:29:18 +0000 (17:29 +0200)]
pbrd: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:28:24 +0000 (17:28 +0200)]
pimd: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agozebra: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:28:12 +0000 (17:28 +0200)]
zebra: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotools: Replace prefix2str for JSON to %pFX
Donatas Abraitis [Thu, 25 Nov 2021 15:26:26 +0000 (17:26 +0200)]
tools: Replace prefix2str for JSON to %pFX

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10115 from donaldsharp/bgp_route_server_convergence
Donatas Abraitis [Thu, 25 Nov 2021 11:24:35 +0000 (13:24 +0200)]
Merge pull request #10115 from donaldsharp/bgp_route_server_convergence

tests: Add aggressive timers to the new route server client test

2 years agoMerge pull request #10008 from qlyoung/update-process-docs
Jafar Al-Gharaibeh [Wed, 24 Nov 2021 19:55:22 +0000 (12:55 -0700)]
Merge pull request #10008 from qlyoung/update-process-docs

doc: update release process

2 years agoMerge pull request #9906 from patrasar/2553196
Donald Sharp [Wed, 24 Nov 2021 17:33:44 +0000 (12:33 -0500)]
Merge pull request #9906 from patrasar/2553196

pimd: During Joined -> NotJoined, upstream should send prune nomatter

2 years agoMerge pull request #10121 from ton31337/feature/match_ipv6_nexthop_prefixlist
Igor Ryzhov [Wed, 24 Nov 2021 16:38:07 +0000 (19:38 +0300)]
Merge pull request #10121 from ton31337/feature/match_ipv6_nexthop_prefixlist

bgpd: Add an ability to match ipv6 next-hop by prefix-list

2 years agoMerge pull request #10116 from donaldsharp/ospf_test_cleanup
Igor Ryzhov [Wed, 24 Nov 2021 14:44:57 +0000 (17:44 +0300)]
Merge pull request #10116 from donaldsharp/ospf_test_cleanup

Ospf test cleanup

2 years agotests: Check if `match ipv6 next-hop prefix-list` command works
Donatas Abraitis [Wed, 24 Nov 2021 14:28:48 +0000 (16:28 +0200)]
tests: Check if `match ipv6 next-hop prefix-list` command works

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Add an ability to match ipv6 next-hop by prefix-list
Donatas Abraitis [Wed, 24 Nov 2021 14:28:31 +0000 (16:28 +0200)]
bgpd: Add an ability to match ipv6 next-hop by prefix-list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: Add `match ipv6 next-hop prefix-list` command
Donatas Abraitis [Wed, 24 Nov 2021 14:25:42 +0000 (16:25 +0200)]
doc: Add `match ipv6 next-hop prefix-list` command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: During Joined -> NotJoined, upstream should send prune nomatter
sarita patra [Wed, 27 Oct 2021 10:32:57 +0000 (03:32 -0700)]
pimd: During Joined -> NotJoined, upstream should send prune nomatter

RCA: When upstream transition from Joined to NotJoined due to SGRpt
prune, then only SGRpt prune was sent and SG Prune is missed.

Fix: Send SG Prune towards source as well as SGRpt prune towards RP.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agotests: Remove create_router_ospf6
Donald Sharp [Wed, 24 Nov 2021 12:04:46 +0000 (07:04 -0500)]
tests: Remove create_router_ospf6

This function is never used, remove.  Developer can use
create_router_ospf instead

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Do not put area under `router ospf6`
Donald Sharp [Tue, 23 Nov 2021 12:56:03 +0000 (07:56 -0500)]
tests: Do not put area under `router ospf6`

The interface area command is deprecated under
router ospf6 and should be on the individual interface.
Let's modify the tests to not actually put the
interface foo area 0.0.0.0 command under the
router node.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Add clear event to creation of router for v4 and v6 ospf
Donald Sharp [Tue, 23 Nov 2021 12:47:33 +0000 (07:47 -0500)]
tests: Add clear event to creation of router for v4 and v6 ospf

When using build_config_from_json there exists a timing
window where neighbors can come up before the router-id
is applied.  As a precaution, quickly clear the neighbors
to ensure that we get neighbors with the expected router-id.
This can especially happen under high system load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Move area configuration to interface for ospv3
Donald Sharp [Tue, 23 Nov 2021 12:24:34 +0000 (07:24 -0500)]
tests: Move area configuration to interface for ospv3

The test_ospf_dual_stack test had area configuration
under the `router ospf6` nodes.  This is getting
lots of warning messages from the cli.  Let's remove
this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Don't double create ospfv3 config
Donald Sharp [Tue, 23 Nov 2021 12:06:05 +0000 (07:06 -0500)]
tests: Don't double create ospfv3 config

When testers use the build_config_from_json function
the create_router_ospf function is double creating
the ospfv3 cli to be passed in.  This is because
the create_router_ospf loops over both v2 and v3
and then create_router_ospf6 re-adds v3.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Do not pick an ip address that overlaps with ourselves
Donald Sharp [Wed, 24 Nov 2021 01:16:29 +0000 (20:16 -0500)]
tests: Do not pick an ip address that overlaps with ourselves

The ospf_basic_functionality/test_ospf_lan.py creates
a ethernet segment and attaches 4 routers to it and
assigns ip addresses in a /24.  As one of the tests
it picks a new address for r0 which coincides with
a ip address on r3.  Then the test immediatly
checks for other data.  The problem is of course
that if a test is `slow` enough hello's will
start to be ignored from r3 to r0 and the
neighbor relationships will come down.  Choose
an ip address that doesn't cause this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10113 from donaldsharp/ospf6_external_id_table
Igor Ryzhov [Wed, 24 Nov 2021 11:54:27 +0000 (14:54 +0300)]
Merge pull request #10113 from donaldsharp/ospf6_external_id_table

ospf6d: Remove ospf6->external_id_table

2 years agotests: Add aggressive timers to the new route server client test
Donald Sharp [Wed, 24 Nov 2021 01:19:05 +0000 (20:19 -0500)]
tests: Add aggressive timers to the new route server client test

The new bgp_route_server_client test is not setting the
timers for peers to be fast enough to have the ability
to converge in under 60 seconds if a packet is dropped/missed
at startup.  Make the test have the ability to converge
under load

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10100 from rgirada/ospf_nssa
Donald Sharp [Wed, 24 Nov 2021 00:52:19 +0000 (19:52 -0500)]
Merge pull request #10100 from rgirada/ospf_nssa

ospfd: ospf routing table update upon Changing area from normal to nssa

2 years agoMerge pull request #10111 from idryzhov/staticd-ifup-cleanup
Donald Sharp [Wed, 24 Nov 2021 00:50:44 +0000 (19:50 -0500)]
Merge pull request #10111 from idryzhov/staticd-ifup-cleanup

staticd: remove unnecessary function call

2 years agoospf6d: Remove ospf6->external_id_table
Donald Sharp [Wed, 24 Nov 2021 00:46:16 +0000 (19:46 -0500)]
ospf6d: Remove ospf6->external_id_table

The external_id_table was only ever used to store pointers to data
and was never used for lookup during the course of normal operations.
However it did lead to crashes because somewhere along the way
external routes stored in the external_table never had their
id associated into the external_id_table and we would assert
on the node lookup failing.

Since this code was never used for anything other than
storing data and it was never retrieved for anything useful
let's just remove it from ospf6d.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: add "json" option to "show ip bgp ... dampening parameters"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... dampening parameters"

Also:
* rename show_ip_bgp_cmd to show_ip_bgp_dampening_params_cmd;
* rename show_ip_bgp_json_cmd to show_ip_bgp_cmd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: add "json" option to "show ip bgp ... longer-prefixes"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... longer-prefixes"

Move the "longer-prefixes" option from show_ip_bgp_cmd to
show_ip_bgp_json_cmd so that is has access to JSON output.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: add "json" option to "show ip bgp ... route-map"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... route-map"

Move the "route-map" option from show_ip_bgp_cmd to
show_ip_bgp_json_cmd so that is has access to JSON output.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: add "json" option to "show ip bgp ... filter-list"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... filter-list"

Move the "filter-list" option from show_ip_bgp_cmd to
show_ip_bgp_json_cmd so that is has access to JSON output.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: add "json" option to "show ip bgp ... prefix-list"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... prefix-list"

Move the "prefix-list" option from show_ip_bgp_cmd to
show_ip_bgp_json_cmd so that is has access to JSON output.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: add "json" option to "show ip bgp ... community-list"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: add "json" option to "show ip bgp ... community-list"

Move the "community-list" option from show_ip_bgp_cmd to
show_ip_bgp_json_cmd so that is has access to JSON output.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: use void pointer to reduce code duplication
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: use void pointer to reduce code duplication

There's no need to have different calls to bgp_show() when the only
difference is one argument that corresponds to a "void *" parameter.

Code duplication should be reduced to a minimum to avoid bugs like
the one fixed in the previous commit.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agobgpd: fix crash in "show ip bgp ... all alias ALIAS"
Renato Westphal [Wed, 28 Jul 2021 01:29:43 +0000 (22:29 -0300)]
bgpd: fix crash in "show ip bgp ... all alias ALIAS"

Like done in the other places (when "all" isn't used), pass the
actual alias name to bgp_show() instead of a null pointer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoMerge pull request #10112 from ton31337/feature/route-map_autocomplete
Igor Ryzhov [Tue, 23 Nov 2021 16:05:27 +0000 (19:05 +0300)]
Merge pull request #10112 from ton31337/feature/route-map_autocomplete

lib: Use autocomplete for `route-map <name> <action> <seq>`

2 years agolib: Use autocomplete for `route-map <name> <action> <seq>`
Donatas Abraitis [Tue, 23 Nov 2021 14:05:25 +0000 (16:05 +0200)]
lib: Use autocomplete for `route-map <name> <action> <seq>`

```
exit1-debian-11(config)# route-map ?
  RMAP_NAME  Route map tag
     belekas testas
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Add missing LLGR capability handling stuff
Donatas Abraitis [Sun, 21 Nov 2021 21:00:15 +0000 (23:00 +0200)]
bgpd: Add missing LLGR capability handling stuff

```
OPEN has (no message found) capability (71), length 14
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10024 from ton31337/feature/match_ipv6_next-hop_access-list
Igor Ryzhov [Tue, 23 Nov 2021 13:45:25 +0000 (16:45 +0300)]
Merge pull request #10024 from ton31337/feature/match_ipv6_next-hop_access-list

bgpd: match ipv6 next-hop

2 years agotests: Test if `match ipv6 next-hop` works
Donatas Abraitis [Mon, 22 Nov 2021 19:27:05 +0000 (21:27 +0200)]
tests: Test if `match ipv6 next-hop` works

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Add an ability to match ipv6 next-hop by access-list
Donatas Abraitis [Mon, 22 Nov 2021 19:26:33 +0000 (21:26 +0200)]
bgpd: Add an ability to match ipv6 next-hop by access-list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agostaticd: remove unnecessary function call
Igor Ryzhov [Thu, 18 Nov 2021 18:18:43 +0000 (21:18 +0300)]
staticd: remove unnecessary function call

When the VRF interface is coming up, we don't need to fixup VRF ids - it
was already done in static_vrf_enable when the interface was created.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10040 from idryzhov/ifp-vrf-id-cleanup
Donatas Abraitis [Tue, 23 Nov 2021 09:43:48 +0000 (11:43 +0200)]
Merge pull request #10040 from idryzhov/ifp-vrf-id-cleanup

*: cleanup ifp->vrf_id

2 years agodoc: Add `match ipv6 next-hop ACCESS6_NAME`
Donatas Abraitis [Mon, 22 Nov 2021 19:25:39 +0000 (21:25 +0200)]
doc: Add `match ipv6 next-hop ACCESS6_NAME`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9919 from mobash-rasool/pim-upst-3
Donald Sharp [Mon, 22 Nov 2021 19:42:56 +0000 (14:42 -0500)]
Merge pull request #9919 from mobash-rasool/pim-upst-3

pimd: STAR inherited Flag not properly set in certain scenarios

2 years ago*: cleanup ifp->vrf_id
Igor Ryzhov [Thu, 21 Oct 2021 22:17:40 +0000 (01:17 +0300)]
*: cleanup ifp->vrf_id

Since f60a1188 we store a pointer to the VRF in the interface structure.
There's no need anymore to store a separate vrf_id field.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10057 from ton31337/fix/we_shouldn_send_LLA_for_RS
Donald Sharp [Mon, 22 Nov 2021 17:06:36 +0000 (12:06 -0500)]
Merge pull request #10057 from ton31337/fix/we_shouldn_send_LLA_for_RS

bgpd: Do not send LLA for route-server-client peers

2 years agoMerge pull request #10076 from idryzhov/if-is-loopback-or-vrf
Donald Sharp [Mon, 22 Nov 2021 17:02:21 +0000 (12:02 -0500)]
Merge pull request #10076 from idryzhov/if-is-loopback-or-vrf

*: unify if_is_loopback/if_is_loopback_or_vrf

2 years agoMerge pull request #10070 from idryzhov/ospf6-memcmp-cleanup
Quentin Young [Mon, 22 Nov 2021 14:33:52 +0000 (09:33 -0500)]
Merge pull request #10070 from idryzhov/ospf6-memcmp-cleanup

2 years agoMerge pull request #10083 from karelvanhecke/master
Donald Sharp [Mon, 22 Nov 2021 14:02:49 +0000 (09:02 -0500)]
Merge pull request #10083 from karelvanhecke/master

redhat: check if frr.conf already exists

2 years agoMerge pull request #10096 from mjstapp/fix_ted_free
Donatas Abraitis [Mon, 22 Nov 2021 13:38:05 +0000 (15:38 +0200)]
Merge pull request #10096 from mjstapp/fix_ted_free

lib: use _safe iteration during link_state/ted cleanup

2 years agoMerge pull request #10088 from opensourcerouting/pim-forward-stop
Donald Sharp [Mon, 22 Nov 2021 13:30:18 +0000 (08:30 -0500)]
Merge pull request #10088 from opensourcerouting/pim-forward-stop

pimd: fix stale forwarding entries left around after join goes away

2 years agoMerge pull request #10102 from idryzhov/match-ip-nexthop
Donatas Abraitis [Mon, 22 Nov 2021 13:24:33 +0000 (15:24 +0200)]
Merge pull request #10102 from idryzhov/match-ip-nexthop

bgpd, lib: fix inconsistency of match ip/ipv6 next-hop commands

2 years agoMerge pull request #10103 from donaldsharp/python_exabgp_fun
Donatas Abraitis [Mon, 22 Nov 2021 12:08:19 +0000 (14:08 +0200)]
Merge pull request #10103 from donaldsharp/python_exabgp_fun

tests: Explicitly call out which version of python we need

2 years agotests: Fix tests using exabgp to explicitly call out which python to use
Donald Sharp [Sat, 20 Nov 2021 00:18:30 +0000 (19:18 -0500)]
tests: Fix tests using exabgp to explicitly call out which python to use

There exist systems that do not explicity have a python soft-link
on their system.  Let's explicity call out which python we want
to be using with exabgp.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9683 from volta-networks/sr-minor-fixes
Igor Ryzhov [Sat, 20 Nov 2021 11:53:09 +0000 (14:53 +0300)]
Merge pull request #9683 from volta-networks/sr-minor-fixes

ospfd, isisd: minor SR fixes

2 years agobgpd, lib: fix inconsistency of match ip/ipv6 next-hop commands
Igor Ryzhov [Fri, 19 Nov 2021 18:11:52 +0000 (21:11 +0300)]
bgpd, lib: fix inconsistency of match ip/ipv6 next-hop commands

For IPv4 matching, we have "match ip next-hop address A.B.C.D".
For IPv6 matching, we have "match ipv6 next-hop X:X::X:X".

To have consistency, let's add "address" keyword to IPv6 commands.
Old commands are preserved as hidden for backward compatibility.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10097 from pguibert6WIND/ipv6_fix_ecom_list
Donatas Abraitis [Fri, 19 Nov 2021 12:50:01 +0000 (14:50 +0200)]
Merge pull request #10097 from pguibert6WIND/ipv6_fix_ecom_list

bgpd: support redirect import more than one route-target ipv6

2 years agoMerge pull request #10074 from opensourcerouting/assorted-20211116
Igor Ryzhov [Fri, 19 Nov 2021 12:43:10 +0000 (15:43 +0300)]
Merge pull request #10074 from opensourcerouting/assorted-20211116

lib/vtysh/ospf6d: assorted small bits

2 years agoMerge pull request #9970 from mobash-rasool/pim-upst-1
Donald Sharp [Fri, 19 Nov 2021 11:19:28 +0000 (06:19 -0500)]
Merge pull request #9970 from mobash-rasool/pim-upst-1

pimd : packet processing optimization on rp change

2 years agoospfd: ospf routing table update upon Changing area from normal to nssa
rgirada [Fri, 19 Nov 2021 08:09:29 +0000 (00:09 -0800)]
ospfd: ospf routing table update upon Changing area from normal to nssa

Description:
When changing the area from normal to NSSA, previous area's
ASBR router's type-5 also calculated and added to routing table along
with Type-7 lsas.
Made a change in route calculation such that it will not consider Type-5
lsas in calculation if it is originated from NSSA ASBR router.
These lsas will be age out at MAX age.

  log:
  frr(config-router)# do show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
         O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
         T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
         f - OpenFabric,
         > - selected route, * - FIB route, q - queued, r - rejected, b - backup
         t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/0] via 10.112.157.253, ens160, 00:32:47
C>* 10.112.156.0/23 is directly connected, ens160, 00:32:47
S>* 22.22.22.2/32 [1/0] is directly connected, ens192, weight 1, 00:20:03
O>* 33.33.33.0/24 [110/20] via 100.1.1.220, ens192, weight 1, 00:08:55
   via 100.1.1.220, ens192, weight 1, 00:08:55
O   100.1.1.0/24 [110/10] is directly connected, ens192, weight 1, 00:21:32
C>* 100.1.1.0/24 is directly connected, ens192, 00:23:11
  frr(config-router)# do show ip ospf  route
============ OSPF network routing table ============
N    100.1.1.0/24          [10] area: 0.0.0.1
                           directly attached to ens192

============ OSPF router routing table =============
R    2.2.2.2               [10] area: 0.0.0.1, ASBR
                           via 100.1.1.220, ens192

============ OSPF external routing table ===========
N E2 33.33.33.0/24         [10/20] tag: 0
                           via 100.1.1.220, ens192
                           via 100.1.1.220, ens192

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agopimd : packet processing optimization on rp change
Mobashshera Rasool [Fri, 5 Nov 2021 07:11:57 +0000 (00:11 -0700)]
pimd : packet processing optimization on rp change

Problem Statement:
==================
on rp_change, PIM processes all the upstream in a loop and for selected
upstreams PIM has to send join/prune based on the RPF changed.
join and prune packets are not getting aggregated in a single packet.

Root Cause Analysis:
====================
on pim_rp_change pim_upstream_update() gets called for selected upstreams.
This API calculates to whom it has to send join and to whom it has to
send prune via API pim_zebra_upstream_rpf_changed(). This API peprares
the upstream_switch_list list per interface and inserts the group and
sources.
Now PIM is still in the pim_upstream_update() API context, i.e PIM
is still processing the same upstream. In the last there is a
call to pim_zebra_update_all_interfaces() which processes the
upstream_switch_list list, sends the packets out and clears the list.

Fix:
====
Don't process the upstream_switch_list in the upstream context.
process all the upstreams prepare the upstream_switch_list and then
process in one go. This will club all the S,G entries.
It also saves list cleanup with respect to memory allocation and
deallocation multiple times.

Signed-off-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10092 from ton31337/feature/replace_json_object_string_add_to_jso...
Igor Ryzhov [Thu, 18 Nov 2021 19:19:40 +0000 (22:19 +0300)]
Merge pull request #10092 from ton31337/feature/replace_json_object_string_add_to_json_object_string_addf_for_inet_ntop

*: inet_ntop for JSON output

2 years agobgpd: support redirect import more than one route-target ipv6
Philippe Guibert [Fri, 29 Nov 2019 10:57:29 +0000 (11:57 +0100)]
bgpd: support redirect import more than one route-target ipv6

the fix consists in parsing the ext community list ipv6 by taking
account the size of the ecommunity val size.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9706 from donaldsharp/zebra_client_summ_more_room
Russ White [Thu, 18 Nov 2021 17:19:44 +0000 (12:19 -0500)]
Merge pull request #9706 from donaldsharp/zebra_client_summ_more_room

zebra: Expand v4/v6 route space

2 years agoMerge pull request #10095 from imzyxwvu/nb-validation
Igor Ryzhov [Thu, 18 Nov 2021 16:52:32 +0000 (19:52 +0300)]
Merge pull request #10095 from imzyxwvu/nb-validation

lib: Do not use sizeof() on `size_t errmsg_len`.

2 years ago*: Remove unused variables
Donatas Abraitis [Thu, 18 Nov 2021 09:15:33 +0000 (11:15 +0200)]
*: Remove unused variables

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agozebra: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:58:23 +0000 (10:58 +0200)]
zebra: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:58:09 +0000 (10:58 +0200)]
pimd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospf6d: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:55 +0000 (10:57 +0200)]
ospf6d: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:40 +0000 (10:57 +0200)]
ospfd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agolib: use _safe iteration during link_state/ted cleanup
Mark Stapp [Thu, 18 Nov 2021 16:23:39 +0000 (11:23 -0500)]
lib: use _safe iteration during link_state/ted cleanup

Use the _safe iterators when cleaning up the link-state module's
vertices, edges, and subnets.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10080 from mjstapp/fix_lsp_workqueue
Igor Ryzhov [Thu, 18 Nov 2021 15:47:35 +0000 (18:47 +0300)]
Merge pull request #10080 from mjstapp/fix_lsp_workqueue

zebra: ignore workqueue delete callbacks during shutdown

2 years agolib: Do not use sizeof() on `size_t errmsg_len`.
zyxwvu Shi [Thu, 18 Nov 2021 14:42:12 +0000 (22:42 +0800)]
lib: Do not use sizeof() on `size_t errmsg_len`.

This prevents caller from getting complete
validation message.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
2 years agozebra: during shutdown, don't process LSPs on the lsp workqueue
Mark Stapp [Thu, 18 Nov 2021 12:21:34 +0000 (07:21 -0500)]
zebra: during shutdown, don't process LSPs on the lsp workqueue

During zebra shutdown, we clear out the LSP workqueue. The LSPs
will be uninstalled and freed during the shutdown process, so
just ignore any LSPs that happen to be on the workqueue.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: free LSP workqueue early, revert PR 10050
Mark Stapp [Thu, 18 Nov 2021 12:32:01 +0000 (07:32 -0500)]
zebra: free LSP workqueue early, revert PR 10050

this reverts commit dd9538c5f36f9d6110, which tried to clear
the LSP workqueue late during shutdown.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agolib: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:22 +0000 (10:57 +0200)]
lib: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoldpd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:57:01 +0000 (10:57 +0200)]
ldpd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Replace inet_ntop to %pI4/6 for JSON outputs
Donatas Abraitis [Thu, 18 Nov 2021 08:55:47 +0000 (10:55 +0200)]
bgpd: Replace inet_ntop to %pI4/6 for JSON outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotools: Add coccinelle script to replace inet_ntop inside JSON
Donatas Abraitis [Thu, 18 Nov 2021 08:55:13 +0000 (10:55 +0200)]
tools: Add coccinelle script to replace inet_ntop inside JSON

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10091 from donaldsharp/ospf6_thread_stop
Igor Ryzhov [Thu, 18 Nov 2021 09:19:20 +0000 (12:19 +0300)]
Merge pull request #10091 from donaldsharp/ospf6_thread_stop

ospf6d: Prevent use after free

2 years agoMerge pull request #10077 from idryzhov/pim-if-addr-add
Donatas Abraitis [Thu, 18 Nov 2021 08:34:33 +0000 (10:34 +0200)]
Merge pull request #10077 from idryzhov/pim-if-addr-add

pimd: use correct VRF when processing interface address add

2 years agoMerge pull request #10084 from opensourcerouting/json-sugar
Donatas Abraitis [Thu, 18 Nov 2021 08:33:52 +0000 (10:33 +0200)]
Merge pull request #10084 from opensourcerouting/json-sugar

lib: make JSON output less painful/boilerplate-y

2 years agoospf6d: Prevent use after free
Donald Sharp [Wed, 17 Nov 2021 23:46:06 +0000 (18:46 -0500)]
ospf6d: Prevent use after free

I encountered a crash where the ospf6_write thread
was already thought to be scheduled by ospf6d:

(gdb) bt
    t_ptr=0x5624ee6bd260) at lib/thread.c:972
(gdb)

When poking around it was noticed that the ospf6 pointer was crap:
(gdb) p (struct ospf6 *)$7
$8 = (struct ospf6 *) 0x5624ee6c6b20
(gdb) p *$8
$9 = {vrf_id = 3998487040, name = 0x5624ee420010 "\a", router_id = 65892, router_id_static = 65892, router_id_zebra = 0, starttime = {tv_sec = 1654674, tv_usec = 678673},
  area_list = 0x0, backbone = 0x5624ee6c6710, lsdb = 0x5624ee6c2370, lsdb_self = 0x5624ee6c5d80, route_table = 0x5624ee6c5c10, brouter_table = 0x5624ee6c4690,
  external_table = 0x5624ee6c4710, external_id_table = 0x5624ee6c4f10, external_id = 24, redist = {0x0 <repeats 32 times>}, nssa_default_import_check = {refcnt = 0,
    status = false}, flag = 1 '\001', redistribute = 0, config_flags = 0 '\000', default_originate = 0, lsa_minarrival = 1000, spf_delay = 0, spf_holdtime = 50,
  spf_max_holdtime = 5000, spf_hold_multiplier = 1, spf_reason = 554, ts_spf = {tv_sec = 1654712, tv_usec = 122041}, ts_spf_duration = {tv_sec = 0, tv_usec = 48},
  last_spf_reason = 11, fd = -1, t_spf_calc = 0x0, t_ase_calc = 0x0, maxage_remover = 0x0, t_distribute_update = 0x0, t_ospf6_receive = 0x0, t_external_aggr = 0x0,
  t_write = 0x5624ee6cc930, write_oi_count = 20, ref_bandwidth = 100000, distance_all = 0 '\000', distance_intra = 0 '\000', distance_inter = 0 '\000',
  distance_external = 0 '\000', distance_table = 0x5624ee6c4f50, inst_shutdown = 1 '\001', max_multipath = 128, gr_info = {restart_support = false, restart_in_progress = false,
    prepare_in_progress = false, finishing_restart = false, grace_period = 0, t_grace_period = 0x0}, ospf6_helper_cfg = {supported_grace_time = 1800, is_helper_supported = false,
    strict_lsa_check = true, only_planned_restart = false, enable_rtr_list = 0x0, active_restarter_cnt = 0, last_exit_reason = 0}, anyNSSA = 0 '\000', t_abr_task = 0x0,
  oi_write_q = 0x0, redist_count = 0, aggr_action = 1, aggr_delay_interval = 6, rt_aggr_tbl = 0x5624ee6c51b0, qobj_node = {nid = 6163304287853836241, nodehash = {hi = {next = 0x0,
        hashval = 1613461457}}, type = 0x5624ed65e4e0 <qobj_t_ospf6>}}

Upon code inspection there was no place where we disabled the t_write thread upon ospf6 deletion.
If the code were to issue a `no router ospf6` and then recreate it.  We could see this crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10089 from donaldsharp/really_remove
Donatas Abraitis [Wed, 17 Nov 2021 19:41:50 +0000 (21:41 +0200)]
Merge pull request #10089 from donaldsharp/really_remove

vtysh: Really remove `address-family evpn`

2 years agovtysh: Really remove `address-family evpn`
Donald Sharp [Wed, 17 Nov 2021 16:20:43 +0000 (11:20 -0500)]
vtysh: Really remove `address-family evpn`

I don't know how my original compile didn't fail
or I didn't notice :(

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10086 from donaldsharp/cpp_removal
Igor Ryzhov [Wed, 17 Nov 2021 16:07:19 +0000 (19:07 +0300)]
Merge pull request #10086 from donaldsharp/cpp_removal

tools, vtysh: Remove final vestige of `address-family evpn`

2 years agoMerge pull request #10087 from donaldsharp/core_file_restore
David Lamparter [Wed, 17 Nov 2021 16:00:19 +0000 (17:00 +0100)]
Merge pull request #10087 from donaldsharp/core_file_restore

2 years agopimd: fix event order for forward_stop()
David Lamparter [Sun, 24 Oct 2021 11:46:06 +0000 (13:46 +0200)]
pimd: fix event order for forward_stop()

`pim_ifchannel_ifjoin_switch()` changes flags that `pim_forward_stop()`
looks at.  This leads to data flow continuing until we have some reason
to sync state again.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>