]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
21 months agoMerge pull request #11844 from SaiGomathiN/ttable-1
Donatas Abraitis [Fri, 26 Aug 2022 08:48:18 +0000 (11:48 +0300)]
Merge pull request #11844 from SaiGomathiN/ttable-1

pimd, pim6d: Using ttable for displaying show CLIs

21 months agoMerge pull request #11854 from donaldsharp/memory_walk_in_gdb
Donatas Abraitis [Fri, 26 Aug 2022 07:20:58 +0000 (10:20 +0300)]
Merge pull request #11854 from donaldsharp/memory_walk_in_gdb

gdb: Add a macro to walk memory allocations

21 months agoMerge pull request #11862 from sri-mohan1/sri-ospf-dbg1
mobash-rasool [Fri, 26 Aug 2022 06:38:53 +0000 (12:08 +0530)]
Merge pull request #11862 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agoospfd: changes for code maintainability
sri-mohan1 [Thu, 25 Aug 2022 18:14:50 +0000 (23:44 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agoMerge pull request #11860 from opensourcerouting/fix/evpn_cli_json
Donald Sharp [Thu, 25 Aug 2022 17:20:19 +0000 (13:20 -0400)]
Merge pull request #11860 from opensourcerouting/fix/evpn_cli_json

bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

21 months agoMerge pull request #11858 from sri-mohan1/sri-ospf-dbg1
Donald Sharp [Thu, 25 Aug 2022 13:25:10 +0000 (09:25 -0400)]
Merge pull request #11858 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agoMerge pull request #11859 from liwg06/master.fix.extra.semicolon
Mark Stapp [Thu, 25 Aug 2022 12:53:36 +0000 (08:53 -0400)]
Merge pull request #11859 from liwg06/master.fix.extra.semicolon

lib: Fix extra semicolon after if

21 months agobgpd: Drop bnc_str() function
Donatas Abraitis [Thu, 25 Aug 2022 10:53:30 +0000 (13:53 +0300)]
bgpd: Drop bnc_str() function

Reuse %pFX -> prefix2str()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Convert prefix2str to %pFX
Donatas Abraitis [Thu, 25 Aug 2022 10:46:58 +0000 (13:46 +0300)]
bgpd: Convert prefix2str to %pFX

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Do not print new line for EVPN CLI outputs if it's a JSON
Donatas Abraitis [Thu, 25 Aug 2022 10:15:27 +0000 (13:15 +0300)]
bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

Before:

```
$ vtysh -c 'show bgp l2vpn evpn route detail json'
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
{
...
"numPrefix":4,
"numPaths":4 <<<<< four paths = four empty lines
}
```

Contain as much "empty lines" before the JSON string as the number
of paths displayed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agolib: Fix extra semicolon after if
Weiguo Li [Thu, 25 Aug 2022 09:51:46 +0000 (17:51 +0800)]
lib: Fix extra semicolon after if

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
21 months agoospfd: changes for code maintainability
sri-mohan1 [Wed, 24 Aug 2022 17:56:16 +0000 (23:26 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agopimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI
Sai Gomathi N [Mon, 22 Aug 2022 05:58:42 +0000 (22:58 -0700)]
pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
21 months agopimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI
Sai Gomathi N [Mon, 22 Aug 2022 05:35:04 +0000 (22:35 -0700)]
pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
21 months agoMerge pull request #11829 from donaldsharp/time_32_bits
Jafar Al-Gharaibeh [Wed, 24 Aug 2022 16:25:16 +0000 (11:25 -0500)]
Merge pull request #11829 from donaldsharp/time_32_bits

Time 32 bits

21 months agoMerge pull request #11856 from opensourcerouting/fix/revert_clist_internet
Mark Stapp [Wed, 24 Aug 2022 13:32:19 +0000 (09:32 -0400)]
Merge pull request #11856 from opensourcerouting/fix/revert_clist_internet

bgpd: Revert community-list INTERNET stuff

21 months agoripd: Use a sequence number instead of time
Donald Sharp [Wed, 17 Aug 2022 23:05:33 +0000 (19:05 -0400)]
ripd: Use a sequence number instead of time

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobabeld: Remove return value for gettime()
Donald Sharp [Wed, 17 Aug 2022 23:01:30 +0000 (19:01 -0400)]
babeld: Remove return value for gettime()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Convert time to uint64_t for zclient data structures
Donald Sharp [Wed, 17 Aug 2022 22:58:50 +0000 (18:58 -0400)]
zebra: Convert time to uint64_t for zclient data structures

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopimd: Intentionally downcast to a uint32_t value
Donald Sharp [Wed, 17 Aug 2022 22:43:09 +0000 (18:43 -0400)]
pimd: Intentionally downcast to a uint32_t value

When calling time(NULL), FRR is intentionally throwing
away the upper 32 bits of value returned.  Let's explicitly
call it out so that coverity understands this is intentional
and ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Replace rfapi_time() with monotime()
Donald Sharp [Wed, 17 Aug 2022 22:32:14 +0000 (18:32 -0400)]
bgpd: Replace rfapi_time() with monotime()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Convert from bgp_clock() to monotime()
Donald Sharp [Wed, 17 Aug 2022 22:27:54 +0000 (18:27 -0400)]
bgpd: Convert from bgp_clock() to monotime()

Let's convert to our actual library call instead
of using yet another abstraction that makes it fun
for people to switch daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agogdb: Add a macro to walk memory allocations
Donald Sharp [Tue, 23 Aug 2022 20:31:02 +0000 (16:31 -0400)]
gdb: Add a macro to walk memory allocations

Add a macro to walk all memory allocations in a core file.

load the file in gdb:
source /path/to/frr/gdb/lib.txt
mg_walk mg_first
(gdb) mq_walk mg_first
showing active allocations in memory group libfrr
memstats: BFD info:0
memstats: Buffer:5
memstats: Buffer data:0
memstats: Host config:6
memstats: Completion item:0
memstats: Command Tokens:2585
memstats: Command Token Text:1951
memstats: Command Token Help:1951
memstats: Command Argument:0
memstats: Command Argument Name:575
memstats: Command Match Stack:0
memstats: Lexer token (temporary):0
memstats: Path Computation Algorithms:0
memstats: Distribute ctx:0
memstats: Distribute list:0
memstats: Dist-list ifname:0
memstats: Dist-list name:0
memstats: error information:0
memstats: Access List:0
memstats: Access List Str:0
memstats: Access Filter:0
memstats: RCU thread:0
<snip>

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11848 from rgirada/ospf_gr_nbr
Donatas Abraitis [Wed, 24 Aug 2022 09:39:13 +0000 (12:39 +0300)]
Merge pull request #11848 from rgirada/ospf_gr_nbr

ospfd: Adding per neighbour json details to GR helper detail command

21 months agoMerge pull request #11853 from sri-mohan1/sri-ospf-dbg1
Donatas Abraitis [Wed, 24 Aug 2022 06:19:51 +0000 (09:19 +0300)]
Merge pull request #11853 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agodoc: Define `internet` BGP community
Donatas Abraitis [Wed, 24 Aug 2022 05:59:25 +0000 (08:59 +0300)]
doc: Define `internet` BGP community

Overall, rfc1997 states:

The community attribute values ranging from 0x0000000 through
   0x0000FFFF and 0xFFFF0000 through 0xFFFFFFFF are hereby reserved.

But we have a special handling here, like Cisco IOS XR.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoRevert "bgpd: Drop `internet` community check from community_list_match()"
Donatas Abraitis [Wed, 24 Aug 2022 05:46:56 +0000 (08:46 +0300)]
Revert "bgpd: Drop `internet` community check from community_list_match()"

Seems that, `internet` community is used to match ANY community.

This reverts commit e605d0cfae6a3fc9b65058ec85b55d7d0bd5cc22.

21 months agoRevert "tests: Check if BGP community-list filtering works correctly"
Donatas Abraitis [Wed, 24 Aug 2022 05:46:47 +0000 (08:46 +0300)]
Revert "tests: Check if BGP community-list filtering works correctly"

This reverts commit b08784281471bebb8b8dd4a97e558ae7cc078954.

21 months agoospfd: Adding per neighbour json details to GR helper detail command
rgirada [Mon, 22 Aug 2022 18:15:56 +0000 (11:15 -0700)]
ospfd: Adding per neighbour json details to GR helper detail command

Description:
Per neighbor GR enabled information is  missing from json
output in "show ip ospf gr helper details json" command.

      Example config:

frr(config-router)# graceful-restart helper enable 2.2.2.2
frr(config-router)#
frr(config-router)# do show ip ospf  graceful-restart helper  detail

       OSPF Router with ID (10.112.156.220)

Graceful restart helper support disabled.
Strict LSA check is enabled.
Helper supported for Planned and Unplanned Restarts.
Supported Graceful restart interval: 1800(in seconds).
Enable Router list:
2.2.2.2,

frr(config-router)# do show ip ospf  graceful-restart helper  detail json
{
 "routerId":"10.112.156.220",
 "helperSupport":"Disabled",
 "strictLsaCheck":"Enabled",
 "restartSupoort":"Planned and Unplanned Restarts",
 "supportedGracePeriod":1800,
}
frr(config-router)#

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
21 months agoospfd: changes for code maintainability
sri-mohan1 [Tue, 23 Aug 2022 16:45:38 +0000 (22:15 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agoMerge pull request #11851 from sri-mohan1/sri-ospf-dbg1
Russ White [Tue, 23 Aug 2022 15:07:29 +0000 (11:07 -0400)]
Merge pull request #11851 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agoMerge pull request #11820 from opensourcerouting/fix/clist_match
Russ White [Tue, 23 Aug 2022 15:06:15 +0000 (11:06 -0400)]
Merge pull request #11820 from opensourcerouting/fix/clist_match

bgpd: Fix community-list handling

21 months agoMerge pull request #11836 from ak503/nhrp_nbma
Philippe Guibert [Tue, 23 Aug 2022 15:06:02 +0000 (17:06 +0200)]
Merge pull request #11836 from ak503/nhrp_nbma

nhrpd: Use nhrp_interface_update_nbma when source vrf was changed

21 months agoMerge pull request #11840 from xdxu/master
Russ White [Tue, 23 Aug 2022 14:58:57 +0000 (10:58 -0400)]
Merge pull request #11840 from xdxu/master

ospf6d: Don't remove summary route if it is a range

21 months agoMerge pull request #11842 from opensourcerouting/fix/topotests_platform_check
Russ White [Tue, 23 Aug 2022 14:58:01 +0000 (10:58 -0400)]
Merge pull request #11842 from opensourcerouting/fix/topotests_platform_check

tests: Log as error if some of the daemons are missing

21 months agoMerge pull request #11843 from ARShreenidhi/ecmp_testcase
Russ White [Tue, 23 Aug 2022 14:57:13 +0000 (10:57 -0400)]
Merge pull request #11843 from ARShreenidhi/ecmp_testcase

tests : bgp-default-originate ecmp scenerio is added

21 months agoospfd: changes for code maintainability
sri-mohan1 [Tue, 23 Aug 2022 11:17:37 +0000 (16:47 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agoMerge pull request #11847 from sri-mohan1/sri-ospf-dbg1
mobash-rasool [Tue, 23 Aug 2022 04:57:13 +0000 (10:27 +0530)]
Merge pull request #11847 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agoospfd: changes for code maintainability
sri-mohan1 [Mon, 22 Aug 2022 17:30:35 +0000 (23:00 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agoMerge pull request #11845 from sri-mohan1/sri-ospf-dbg1
Donald Sharp [Mon, 22 Aug 2022 16:46:49 +0000 (12:46 -0400)]
Merge pull request #11845 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agonhrpd: Use nhrp_interface_update_nbma when source vrf was changed
Dmitrii Turlupov [Fri, 19 Aug 2022 14:12:55 +0000 (17:12 +0300)]
nhrpd: Use nhrp_interface_update_nbma when source vrf was changed

1. Run frr:
interface enp0s8
 ip address 193.168.1.2/24
exit
!
interface gre1
 ip address 10.8.1.2/32
 ip nhrp network-id 1
 ip nhrp nhs dynamic nbma 193.168.1.1
 tunnel source enp0s8
exit

Log:

NHS: Register 10.8.1.2 -> 10.8.1.2 (timeout 2)
Send Registration-Request(3) 10.8.1.2 -> 10.8.1.2
Recv Registration-Reply(4) 10.8.1.1 -> 10.8.1.2

2. Create VRF and move enp0s8 to VRF
 ip link set enp0s8 master vrf1

Before patch:
NHS: Waiting link for 193.168.1.1

After patch:
NHS: Register 10.8.1.2 -> 10.8.1.2 (timeout 2)

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
21 months agoospfd: changes for code maintainability
sri-mohan1 [Mon, 22 Aug 2022 12:49:04 +0000 (18:19 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agoMerge pull request #11841 from sri-mohan1/sri-ospf-dbg1
Donatas Abraitis [Mon, 22 Aug 2022 10:11:51 +0000 (13:11 +0300)]
Merge pull request #11841 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

21 months agoospfd: changes for code maintainability
sri-mohan1 [Sat, 20 Aug 2022 05:54:29 +0000 (11:24 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agotests : bgp-default-originate ecmp scenerio is added
ARShreenidhi [Mon, 22 Aug 2022 05:01:43 +0000 (05:01 +0000)]
tests : bgp-default-originate ecmp scenerio is added

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
21 months agotests: Log as error if some of the daemons are missing
Donatas Abraitis [Sat, 20 Aug 2022 18:45:06 +0000 (21:45 +0300)]
tests: Log as error if some of the daemons are missing

Also print runtime directory for topotests if the error occurs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #11835 from crosser/fix-lua-build
Donatas Abraitis [Sat, 20 Aug 2022 13:45:28 +0000 (16:45 +0300)]
Merge pull request #11835 from crosser/fix-lua-build

debian: add lua _binary_ to build dependencies

21 months agoospf6d: Don't remove summary route if it is a range
Xiaodong Xu [Sat, 20 Aug 2022 00:25:41 +0000 (17:25 -0700)]
ospf6d: Don't remove summary route if it is a range

Fix issue #11839.

When the user defines a range in an area other than the backbone area, the
summary route will be announced to the backbone area as an inter-area LSA.
However, if the prefix defined in the range is the same prefix as a connected
route in that area, the LSA won't be announced to the backbone area.

This is because when ospf6d is originating the summary route for the
intra-area route, it finds the range configured by the user and tries to
suppress the route by deleting the existing summary route, which happens to be
the one created by the range.

Although the range definition is not necessary in this case, it should not
fail this use case. So let's just keep the summary route there if it is
created from the user defined range.

Signed-off-by: Xiaodong Xu <stid.smth@gmail.com>
21 months agoMerge pull request #11832 from sigeryang/master
Quentin Young [Fri, 19 Aug 2022 14:16:56 +0000 (10:16 -0400)]
Merge pull request #11832 from sigeryang/master

zebra: trim unused tc dplane result values

21 months agodebian: add lua _binary_ to build dependencies
Eugene Crosser [Fri, 19 Aug 2022 13:56:57 +0000 (15:56 +0200)]
debian: add lua _binary_ to build dependencies

FRR only needs lua library (package libluaX.Y-dev) to be compiled and
linked, but its `configure` script makes use of lua interpreter to
perform its checks. Therefore, `luaX.Y` package is a requisite
build-dependency for debian packaging.

This commit adds the debian package with the lua interpreter to the
build dependencies.

Signed-off-by: Eugene Crosser <crosser@average.org>
21 months agoMerge pull request #11777 from donaldsharp/metaq_processing
Donatas Abraitis [Fri, 19 Aug 2022 11:43:33 +0000 (14:43 +0300)]
Merge pull request #11777 from donaldsharp/metaq_processing

Metaq processing

21 months agoMerge pull request #11827 from sri-mohan1/sri-ospf-dbg1
mobash-rasool [Fri, 19 Aug 2022 10:48:46 +0000 (16:18 +0530)]
Merge pull request #11827 from sri-mohan1/sri-ospf-dbg1

ospfd: changes to improve code maintainability

21 months agoospfd: changes code maintainability
sri-mohan1 [Wed, 17 Aug 2022 20:31:01 +0000 (02:01 +0530)]
ospfd: changes code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
21 months agozebra: trim unused tc dplane result values
Siger Yang [Thu, 18 Aug 2022 15:35:41 +0000 (23:35 +0800)]
zebra: trim unused tc dplane result values

Signed-off-by: Siger Yang <siger.yang@outlook.com>
21 months agoMerge pull request #11830 from AbhishekNR/unused_var
Donald Sharp [Thu, 18 Aug 2022 10:28:51 +0000 (06:28 -0400)]
Merge pull request #11830 from AbhishekNR/unused_var

pimd, pim6d: Removing unused parameter

21 months agoMerge pull request #11485 from AbhishekNR/ipv6_mld_todo
Donatas Abraitis [Thu, 18 Aug 2022 06:47:03 +0000 (09:47 +0300)]
Merge pull request #11485 from AbhishekNR/ipv6_mld_todo

pim6d: Completing "ipv6 mld" config command.

21 months agoMerge pull request #11826 from mjstapp/stop_zebra_last
Donatas Abraitis [Thu, 18 Aug 2022 06:19:04 +0000 (09:19 +0300)]
Merge pull request #11826 from mjstapp/stop_zebra_last

tools: stop zebra daemon last

21 months agoMerge pull request #11817 from AbhishekNR/ttable_pim_rp-info
Donatas Abraitis [Thu, 18 Aug 2022 06:16:00 +0000 (09:16 +0300)]
Merge pull request #11817 from AbhishekNR/ttable_pim_rp-info

pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim rp-info"  command output.

21 months agoMerge pull request #11783 from AbhishekNR/ttbale_show_cli
Donatas Abraitis [Thu, 18 Aug 2022 06:15:34 +0000 (09:15 +0300)]
Merge pull request #11783 from AbhishekNR/ttbale_show_cli

pimd, pim6d: Using ttable for displaying show ip/ipv6 pim CLI's output

21 months agopimd, pim6d: Removing unused parameter
Abhishek N R [Thu, 18 Aug 2022 06:09:11 +0000 (23:09 -0700)]
pimd, pim6d: Removing unused parameter

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agozebra: No need for a rib_delete before a rib_add
Donald Sharp [Wed, 10 Aug 2022 00:09:03 +0000 (20:09 -0400)]
zebra: No need for a rib_delete before a rib_add

In kernel_socket.c, the code is deleting and then adding
the route back in on a change operation.  This just translates
too two re's, one for deletion and one for addition.  The deletion
will just be ignored.  Let's not do the extra deletion.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: use rib_add_multipath in rt_netlink.c
Donald Sharp [Wed, 10 Aug 2022 00:07:09 +0000 (20:07 -0400)]
zebra: use rib_add_multipath in rt_netlink.c

The new route code path was using a combination of
both rib_add() and rib_add_multipath() let's clean
it up some to use rib_add_multipath()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Create a zebra_rib_route_entry_new function and use it
Donald Sharp [Tue, 9 Aug 2022 23:56:08 +0000 (19:56 -0400)]
zebra: Create a zebra_rib_route_entry_new function and use it

Abstract the creation of the route_entry and use it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Introduce early route processing on the MetaQ
Donald Sharp [Tue, 2 Aug 2022 17:57:18 +0000 (13:57 -0400)]
zebra: Introduce early route processing on the MetaQ

Currently if an operator does this operation:

sharpd@eva ~/frr8> sudo ip nexthop add id 5000 via 192.168.119.44 dev enp39s0 ; sudo ip route add 10.0.0.1 nhid 5000
2022/06/30 08:52:40 ZEBRA: [ZHQK5-J9M1R] proto2zebra: Please add this protocol(0) to proper rt_netlink.c handling
2022/06/30 08:52:40 ZEBRA: [PS16P-365FK][EC 4043309076] Zebra failed to find the nexthop hash entry for id=5000 in a route entry
sharpd@eva ~/frr8> vtysh -c "show ip route 10.0.0.1"
Routing entry for 0.0.0.0/0
  Known via "kernel", distance 0, metric 100, best
  Last update 00:01:58 ago
  * 192.168.119.1, via enp39s0

The route is dropped by zebra with no warnings.  This is not good,
but unlikely to happen at this point in time.  In order to fix
this issue route processing from inputs needs to happen after nexthop
group processing from inputs.  This was not possible because
nexthop groups are placed on the metaQ.  As such the above
nexthop group creation is placed on the metaQ for processing
in META_QUEUE_NHG.  Then the route is read in and processed
immediately.  The nexthop group is not found ( not processed yet!)
and the route is dropped in zebra.

Modify the code to have early route processing of validity
on the MetaQ.  This preserves the order of operations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Convert label processing to Meta-Q
Donald Sharp [Tue, 9 Aug 2022 20:00:24 +0000 (16:00 -0400)]
zebra: Convert label processing to Meta-Q

Convert label processing that comes from zapi messages
into being handled by the meta-Q.  This is because early
route processing is going to be moved to the meta-Q as
well and we will have a chicken and egg problem without
moving this code to be processed by the meta-Q.

Ordering of messages from ospf as an example:
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:48] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:62] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:43] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:61] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_ROUTE_ADD:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:66] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36]
2022/08/09 08:55:52.740 ZEBRA: [YXG8K-BCYMV] zebra message[ZEBRA_MPLS_LABELS_REPLACE:0:47] comes from socket [36]

The ZEBRA_MPLS_LABELS_REPLACE immediately turn around and attempt to replace nexthop labels on routes that
were added.  If the route add is placed on the metaQ, it will not exist yet and as such the label replace
will fail.

Modify the zebra code to take the label operations and place them on the metaQ as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11824 from sigeryang/master
Donald Sharp [Wed, 17 Aug 2022 13:59:37 +0000 (09:59 -0400)]
Merge pull request #11824 from sigeryang/master

zebra: fix deadcodes in tc dplane & netlink

21 months agoMerge pull request #11819 from sworleys/TC_enum_fix
Christian Hopps [Wed, 17 Aug 2022 13:57:34 +0000 (09:57 -0400)]
Merge pull request #11819 from sworleys/TC_enum_fix

zebra: add TC handlers in script code

21 months agozebra: fix ctab calculation typo in tc netlink
Siger Yang [Wed, 17 Aug 2022 11:02:13 +0000 (19:02 +0800)]
zebra: fix ctab calculation typo in tc netlink

Signed-off-by: Siger Yang <siger.yang@outlook.com>
21 months agozebra: use default NS directly in tc dplane
Siger Yang [Wed, 17 Aug 2022 11:00:39 +0000 (19:00 +0800)]
zebra: use default NS directly in tc dplane

Signed-off-by: Siger Yang <siger.yang@outlook.com>
21 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim rp-info" command output.
Abhishek N R [Tue, 16 Aug 2022 15:21:50 +0000 (08:21 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim rp-info" command output.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agobgpd: Drop `internet` community check from community_list_match()
Donatas Abraitis [Tue, 16 Aug 2022 20:33:51 +0000 (23:33 +0300)]
bgpd: Drop `internet` community check from community_list_match()

Before this, if the community-list has an entry with permit internet (0:0),
then it's treated as permit everything and returned as MATCH.

So if we have something like:

```
bgp community-list standard OUT_AS_PERMIT seq 5 permit internet
bgp community-list standard OUT_AS_PERMIT seq 10 deny 4:1
bgp community-list standard OUT_AS_PERMIT seq 20 permit 3:1
```

It's not gonna work because it will return MATCH and stops parsing.
Routes with 4:1 community will be advertised.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: Check if BGP community-list filtering works correctly
Donatas Abraitis [Tue, 16 Aug 2022 20:33:24 +0000 (23:33 +0300)]
tests: Check if BGP community-list filtering works correctly

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: add TC handlers in script code
Stephen Worley [Tue, 16 Aug 2022 19:56:35 +0000 (15:56 -0400)]
zebra: add TC handlers in script code

Add TC handlers in script code and move non-handled
code together.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
21 months agoMerge pull request #11816 from mobash-rasool/fixes2
Donald Sharp [Tue, 16 Aug 2022 17:52:17 +0000 (13:52 -0400)]
Merge pull request #11816 from mobash-rasool/fixes2

pim6d: Register message getting dropped in source node, mroute stuck in RegJ

21 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-rpf" command...
Abhishek N R [Thu, 11 Aug 2022 11:54:21 +0000 (04:54 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-rpf" command output.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-join-desired...
Abhishek N R [Thu, 11 Aug 2022 11:47:12 +0000 (04:47 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-join-desired" command output.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agoMerge pull request #11694 from sigeryang/master
Stephen Worley [Tue, 16 Aug 2022 15:21:04 +0000 (11:21 -0400)]
Merge pull request #11694 from sigeryang/master

zebra: add basic traffic control API

21 months agoMerge pull request #11805 from opensourcerouting/fix/treat_as_withdraw_if_as_set
Russ White [Tue, 16 Aug 2022 15:17:41 +0000 (11:17 -0400)]
Merge pull request #11805 from opensourcerouting/fix/treat_as_withdraw_if_as_set

bgpd: Treat as withdraw if we receive as path with AS_SET / AS_CONFED_SET

21 months agopim6d: Register message getting dropped in source node, mroute stuck in RegJ
Mobashshera Rasool [Tue, 16 Aug 2022 14:06:40 +0000 (07:06 -0700)]
pim6d: Register message getting dropped in source node, mroute stuck in RegJ

The socket created for pimv6 was created using AF_INET for PIMV6
too.
Since the api pim_reg_sock is common to both PIMv4 and PIMv6,
need to use PIM_AF instead of AF_INET.

Fixes: #11815
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
21 months agoMerge pull request #11809 from opensourcerouting/fix/doc_bgp_clist
Donald Sharp [Tue, 16 Aug 2022 14:17:01 +0000 (10:17 -0400)]
Merge pull request #11809 from opensourcerouting/fix/doc_bgp_clist

doc: Drop `deny` rules from BGP community-list example

21 months agoMerge pull request #11811 from opensourcerouting/fix/bgp_clist_warning
Donald Sharp [Tue, 16 Aug 2022 14:16:40 +0000 (10:16 -0400)]
Merge pull request #11811 from opensourcerouting/fix/bgp_clist_warning

bgpd: Change warning message when BGP community-list is not found

21 months agoMerge pull request #11813 from anlancs/fix/minor-11
Donald Sharp [Tue, 16 Aug 2022 13:46:53 +0000 (09:46 -0400)]
Merge pull request #11813 from anlancs/fix/minor-11

zebra: correct one comment about ethtool ioctl

21 months agoMerge pull request #11814 from mobash-rasool/fixes2
Donatas Abraitis [Tue, 16 Aug 2022 13:39:18 +0000 (16:39 +0300)]
Merge pull request #11814 from mobash-rasool/fixes2

pim6d: Add debug mroute6 commands

21 months agodoc: Adding doc for debug mroute commands
Mobashshera Rasool [Tue, 16 Aug 2022 07:44:56 +0000 (00:44 -0700)]
doc: Adding doc for debug mroute commands

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
21 months agopim6d: Add debug mroute6 and detail commands
Mobashshera Rasool [Tue, 16 Aug 2022 07:42:26 +0000 (00:42 -0700)]
pim6d: Add debug mroute6 and detail commands

Adding below debug CLIs:
debug mroute6
debug mroute6 detail

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
21 months agobgpd: Change warning message when BGP community-list is not found
Donatas Abraitis [Tue, 16 Aug 2022 06:28:21 +0000 (09:28 +0300)]
bgpd: Change warning message when BGP community-list is not found

Before:

```
donatas-laptop# show bgp ipv4 unicast community-list testas
% testas is not a valid community-list name
donatas-laptop# con
donatas-laptop(config)# bgp community-list standard testas permit internet
donatas-laptop(config)# do show bgp ipv4 unicast community-list testas
donatas-laptop(config)#
```

`is not a valid community-list name` is a misleading warning message.

Doing the same for filter-list, access-list, prefix-list, route-map.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodoc: Drop `deny` rules from BGP community-list example
Donatas Abraitis [Tue, 16 Aug 2022 06:10:30 +0000 (09:10 +0300)]
doc: Drop `deny` rules from BGP community-list example

It's an invalid command, probably copy/paste error.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #11804 from donaldsharp/aug_coverity_update
Russ White [Mon, 15 Aug 2022 22:10:03 +0000 (18:10 -0400)]
Merge pull request #11804 from donaldsharp/aug_coverity_update

Aug coverity update

21 months agoMerge pull request #11771 from anlancs/fix/minor-zebra-mh-comment
Donald Sharp [Mon, 15 Aug 2022 21:43:15 +0000 (17:43 -0400)]
Merge pull request #11771 from anlancs/fix/minor-zebra-mh-comment

zebra: correct one comment for evpn-mh

21 months agotools: stop zebra daemon last
Mark Stapp [Mon, 15 Aug 2022 20:40:08 +0000 (16:40 -0400)]
tools: stop zebra daemon last

When stopping the FRR daemons, stop zebra last, after trying
to stop the other daemons.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
21 months agowatchfrr: Check that the operational timeout specified is good.
Donald Sharp [Mon, 15 Aug 2022 16:46:18 +0000 (12:46 -0400)]
watchfrr: Check that the operational timeout specified is good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopbrd: VTY_GET_CONTEXT can fail
Donald Sharp [Mon, 15 Aug 2022 16:01:02 +0000 (12:01 -0400)]
pbrd: VTY_GET_CONTEXT can fail

Although VTY_GET_CONTEXT can return a failed value, it will
never happen in pbrd because of how context work.  In
any event add some code to make coverity happy

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopathd: Ensure path is free'd after we no longer need it.
Donald Sharp [Mon, 15 Aug 2022 15:51:27 +0000 (11:51 -0400)]
pathd: Ensure path is free'd after we no longer need it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agolib: Ensure ls_msg2edge does not use memory after freeing
Donald Sharp [Mon, 15 Aug 2022 15:49:50 +0000 (11:49 -0400)]
lib: Ensure ls_msg2edge does not use memory after freeing

ls_msg2edge calls ls_edge_del_all which will free the
edge variable.  Ensure that FRR properly returns NULL.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopimd: vrf may be NULL from pim_cmd_lookup_vrf
Donald Sharp [Mon, 15 Aug 2022 15:43:27 +0000 (11:43 -0400)]
pimd: vrf may be NULL from pim_cmd_lookup_vrf

The call into pim_cmd_lookup_vrf may be NULL
and dereferencing it before ensuring that the
vrf pointer is non-NULL is a good way to crash.

A crash can be initiated in pim:

eva# show ip msdp vrf NOEXIST mesh-group
vtysh: error reading from pimd: Permission denied (13)Warning: closing connection to pimd because of an I/O error!
eva# 2022/08/15 11:47:38 [PHJDC-499N2][EC 100663314] STARVATION: task vtysh_rl_read (560b77f76de6) ran for 16777ms (cpu time 0ms)

eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopimd: pim_upstream_add up must exist
Donald Sharp [Mon, 15 Aug 2022 15:40:13 +0000 (11:40 -0400)]
pimd: pim_upstream_add up must exist

When calling pim_upstream_add, the lookup for upstream
or the creation of the upstream cannot fail.  As such
up is never NULL.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agopimd: ch->upstream cannot be NULL
Donald Sharp [Mon, 15 Aug 2022 15:39:14 +0000 (11:39 -0400)]
pimd: ch->upstream cannot be NULL

in pim_ifchannel.c there exists several spots where
the ch->upstream is assumed to be NULL.  This is not
possible.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agonhrpd: Use frr_weak_random()
Donald Sharp [Mon, 15 Aug 2022 15:31:21 +0000 (11:31 -0400)]
nhrpd: Use frr_weak_random()

Convert usage of rand() to frr_weak_random()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Treat as withdraw if we receive as path with AS_SET / AS_CONFED_SET
Donatas Abraitis [Mon, 15 Aug 2022 18:41:15 +0000 (21:41 +0300)]
bgpd: Treat as withdraw if we receive as path with AS_SET / AS_CONFED_SET

For now, only if the knob is enabled. Later this gonna be (most likely) removed
and routes with AS_SET / AS_CONFED_SET will be denied by default.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #11781 from donaldsharp/ospf_packet_helper
Donatas Abraitis [Mon, 15 Aug 2022 17:43:49 +0000 (20:43 +0300)]
Merge pull request #11781 from donaldsharp/ospf_packet_helper

Ospf packet helper