]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
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 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

21 months agoMerge pull request #11803 from anlancs/fix/bgp-doc-failover
Donatas Abraitis [Mon, 15 Aug 2022 17:40:40 +0000 (20:40 +0300)]
Merge pull request #11803 from anlancs/fix/bgp-doc-failover

doc: correct description for "fast-external-failover"

21 months agobgpd: Ensure bgp_vrf is non-null
Donald Sharp [Mon, 15 Aug 2022 15:24:42 +0000 (11:24 -0400)]
bgpd: Ensure bgp_vrf is non-null

When calling VTY_GET_CONTEXT to get the bgp pointer,
FRR needs to ensure that the pointer is valid.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Remove unused assignment in zebra_dplane.c
Donald Sharp [Mon, 15 Aug 2022 15:20:59 +0000 (11:20 -0400)]
zebra: Remove unused assignment in zebra_dplane.c

Coverity spotted 3 places where `int ret = XXX` was
being used and FRR was immediately assigning a different
value.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agodoc: correct description for "fast-external-failover"
anlan_cs [Mon, 15 Aug 2022 06:22:46 +0000 (02:22 -0400)]
doc: correct description for "fast-external-failover"

The description for `bgp fast-external-failover` is wrongly opposite.
Just remove the word - `not`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream" command output.
Abhishek N R [Thu, 11 Aug 2022 11:38:02 +0000 (04:38 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream" command output.

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

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

Signed-off-by: Abhishek N R <abnr@vmware.com>
22 months agoMerge pull request #11785 from opensourcerouting/fix/remove_ospf6Enabled_from_JSON
Donald Sharp [Sat, 13 Aug 2022 00:29:47 +0000 (20:29 -0400)]
Merge pull request #11785 from opensourcerouting/fix/remove_ospf6Enabled_from_JSON

ospf6d: Remove ospf6Enabled from JSON output

22 months agoMerge pull request #11784 from anlancs/fix/ospfd-cost-zebra-speed
Donald Sharp [Sat, 13 Aug 2022 00:29:16 +0000 (20:29 -0400)]
Merge pull request #11784 from anlancs/fix/ospfd-cost-zebra-speed

ospf6d: fix missing cost change

22 months agoMerge pull request #11795 from opensourcerouting/fix/drop_enable_systemd
Donald Sharp [Sat, 13 Aug 2022 00:28:27 +0000 (20:28 -0400)]
Merge pull request #11795 from opensourcerouting/fix/drop_enable_systemd

redhat: Drop --enable-systemd from build specification

22 months agoMerge pull request #11799 from sri-mohan1/sri-ospf-1
Donald Sharp [Sat, 13 Aug 2022 00:27:55 +0000 (20:27 -0400)]
Merge pull request #11799 from sri-mohan1/sri-ospf-1

ospfd: debug string corrected

22 months agoMerge pull request #11798 from opensourcerouting/fix/convert_to_void
Donald Sharp [Fri, 12 Aug 2022 18:34:43 +0000 (14:34 -0400)]
Merge pull request #11798 from opensourcerouting/fix/convert_to_void

bgpd: Convert some int functions to void

22 months agoospfd: debug string corrected
sri-mohan1 [Fri, 12 Aug 2022 13:07:42 +0000 (18:37 +0530)]
ospfd: debug string corrected

Debug string for ospf is corrected

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
22 months agobgpd: Convert some int functions to void
Donatas Abraitis [Fri, 12 Aug 2022 10:20:32 +0000 (13:20 +0300)]
bgpd: Convert some int functions to void

The output is not checked, we can have void instead.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoredhat: Drop --enable-systemd from build specification
Donatas Abraitis [Fri, 12 Aug 2022 08:49:33 +0000 (11:49 +0300)]
redhat: Drop --enable-systemd from build specification

This option no longer exists.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11789 from donaldsharp/pw_shutdown
Donatas Abraitis [Fri, 12 Aug 2022 07:40:33 +0000 (10:40 +0300)]
Merge pull request #11789 from donaldsharp/pw_shutdown

zebra: Fix crash in shutdown w/ pw thread still running

22 months agozebra: Fix crash in shutdown w/ pw thread still running
Donald Sharp [Thu, 11 Aug 2022 18:59:17 +0000 (14:59 -0400)]
zebra: Fix crash in shutdown w/ pw thread still running

I am seeing the zebra_pw_install_retry timer thread crashing
on shutdown

The shutdown of the timer is only in an
if () {
   ...
} else if

Let's just always shut it down.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoMerge pull request #11757 from mjstapp/fix_bgp_cond_adv_dev
Donatas Abraitis [Thu, 11 Aug 2022 18:57:21 +0000 (21:57 +0300)]
Merge pull request #11757 from mjstapp/fix_bgp_cond_adv_dev

bgpd: conditional adv fixes

22 months agoospf6d: Remove unused variable
Donald Sharp [Thu, 11 Aug 2022 17:40:50 +0000 (13:40 -0400)]
ospf6d: Remove unused variable

last_serviced_oi is always NULL.  Remove

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoospfd: Add how many packets the interface has queued to send
Donald Sharp [Thu, 11 Aug 2022 11:39:33 +0000 (07:39 -0400)]
ospfd: Add how many packets the interface has queued to send

In `show ip ospf interface traffic` how many packets this
interface has queued to send.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoospfd: Refactor fifo_flush for the interface
Donald Sharp [Thu, 11 Aug 2022 01:56:40 +0000 (21:56 -0400)]
ospfd: Refactor fifo_flush for the interface

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoospfd: When a neighbor goes down clear the oi->obuf if we can
Donald Sharp [Thu, 11 Aug 2022 01:49:37 +0000 (21:49 -0400)]
ospfd: When a neighbor goes down clear the oi->obuf if we can

When a neighbor goes down on an interface and that interface
has no more neighbors in a viable state where packets should
be being sent, then let's clear up the oi->obuf associated
with the interface the neighbor is on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoospfd: Cleanup indentation surrounding oi->nbr
Donald Sharp [Wed, 10 Aug 2022 22:14:23 +0000 (18:14 -0400)]
ospfd: Cleanup indentation surrounding oi->nbr

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agoospfd: Increase packets sent at one time in ospf_write
Donald Sharp [Wed, 10 Aug 2022 20:15:29 +0000 (16:15 -0400)]
ospfd: Increase packets sent at one time in ospf_write

ospf_write pulls an interface off the ospf->oi_write_q
then writes one packet and places it back on the queue,
keeping track of the first one sent.  Then it will
stop sending packets even if we get back to the first
interface written too but before we have sent the full
pkt_count.  I do not believe this makes a whole bunch
of sense and is very restrictive of how much data can
be sent especially if you have a limited number of peers
but large amounts of data.  Why be so restrictive?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
22 months agobgpd: don't adv conditionally withdrawn routes
Quentin Young [Fri, 11 Jun 2021 23:01:42 +0000 (19:01 -0400)]
bgpd: don't adv conditionally withdrawn routes

If we have conditional advertisement enabled, and conditionally withdrew
some prefixes, and then we do a 'clear bgp', those routes were getting
advertised again, and then withdrawn the next time the conditional
advertisement scanner executed.

When we go to advertise check the prefix against the conditional
advertisement status so we don't do that.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
22 months agobgpd: apply cond-adv policy to update group
Quentin Young [Tue, 15 Jun 2021 23:49:19 +0000 (19:49 -0400)]
bgpd: apply cond-adv policy to update group

The new outbound filter to apply conditional advertisement policy was
not working properly due to complications with update groups. The two
routemaps were properly copied into the update group peer filter but not
the conditional advertisement state.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
22 months agoospf6d: Remove ospf6Enabled from JSON output
Donatas Abraitis [Thu, 11 Aug 2022 14:32:24 +0000 (17:32 +0300)]
ospf6d: Remove ospf6Enabled from JSON output

Time to deprecate it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 months agoMerge pull request #11778 from AbhishekNR/ttable_mroute
Donald Sharp [Thu, 11 Aug 2022 12:32:32 +0000 (08:32 -0400)]
Merge pull request #11778 from AbhishekNR/ttable_mroute

pimd, pim6d:  Using ttable for displaying output of show mroute commands

22 months agoMerge pull request #11782 from AbhishekNR/ttable_mroute_count
Donald Sharp [Thu, 11 Aug 2022 12:32:01 +0000 (08:32 -0400)]
Merge pull request #11782 from AbhishekNR/ttable_mroute_count

pimd, pim6d: Using ttable for displaying output of show mroute count command

22 months agoospf6d: fix missing cost change
anlan_cs [Tue, 9 Aug 2022 00:41:22 +0000 (20:41 -0400)]
ospf6d: fix missing cost change

After all needed interfaces ( for example: interface "a1", vrf "vrf1", and
"a1" is binded to "vrf1" ) are ready/created, then restart/start frr. zebra
at startup will call `netlink_interface()` to process all interfaces and notify
all clients, but its calling `get_iflink_speed()` maybe fails for unexpected
order of the coming interfaces: when processing "a1", "vrf1" maybe is unknown
at that time. `if_zebra_speed_update()` timer is introduced to deal with this
order problem.

Currently only ospfd and ospf6d deal with this speed change to recalculated
route cost. ospfd can deal with this change, but ospf6d will wrongly missed it.

Since both `ipv6 ospf6 cost COST` and `auto-cost reference-bandwidth COST` are
not set, cost of this ospf6 interface should be calculated with interface
speed, but it is wrongly kept to `10`, which is based on interface speed being
`0` for it missed speed change. Further, ECMP function becomes invalid after
restart frr, beacuse some ospf6 interfaces of one ECMP are wrongly with cost
`10`.

To avoid missing, recalculate cost for ospf6 interfaces based on potentially
changed speed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
22 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute count" command output.
Abhishek N R [Thu, 11 Aug 2022 08:01:51 +0000 (01:01 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute count" command output.

Signed-off-by: Abhishek N R <abnr@vmware.com>
22 months agozebra: add empty placeholders for tc via BSD socket
Siger Yang [Wed, 10 Aug 2022 15:24:49 +0000 (23:24 +0800)]
zebra: add empty placeholders for tc via BSD socket

This commit adds unimplemented updating functions for traffic control via
BSD socket.

Signed-off-by: Siger Yang <siger.yang@outlook.com>