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

21 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

21 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

21 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

21 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

21 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>
21 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>
21 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>
21 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

21 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>
21 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

21 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>
21 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>
21 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>
21 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>
21 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>
21 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>
21 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>
21 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>
21 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>
21 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

21 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

21 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>
21 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>
21 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>
21 months agozebra: add tc netlink and dplane ops
Siger Yang [Fri, 29 Jul 2022 13:59:19 +0000 (21:59 +0800)]
zebra: add tc netlink and dplane ops

This commit implements necessary netlink encoders for traffic control
including QDISC, TCLASS and TFILTER, and adds basic dplane operations.

Co-authored-by: Stephen Worley <sworley@nvidia.com>
Signed-off-by: Siger Yang <siger.yang@outlook.com>
21 months agoMerge pull request #11775 from AbhishekNR/ttable
Donald Sharp [Wed, 10 Aug 2022 16:29:26 +0000 (12:29 -0400)]
Merge pull request #11775 from AbhishekNR/ttable

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

21 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute" command output.
Abhishek N R [Wed, 10 Aug 2022 15:58:23 +0000 (08:58 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute" command output.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agoMerge pull request #11776 from opensourcerouting/fix/callback_readline
Donald Sharp [Wed, 10 Aug 2022 16:05:21 +0000 (12:05 -0400)]
Merge pull request #11776 from opensourcerouting/fix/callback_readline

vtysh: Handle SIGTSTP (C-z) without exiting the vty shell

21 months agoinclude: add linux header pkt_cls.h
Siger Yang [Mon, 1 Aug 2022 14:37:56 +0000 (22:37 +0800)]
include: add linux header pkt_cls.h

Signed-off-by: Siger Yang <siger.yang@outlook.com>
21 months agoMerge pull request #11774 from donaldsharp/zebra_meta_q_shakeups
Donatas Abraitis [Wed, 10 Aug 2022 13:32:12 +0000 (16:32 +0300)]
Merge pull request #11774 from donaldsharp/zebra_meta_q_shakeups

Zebra meta q shakeups

21 months agovtysh: Handle SIGTSTP (C-z) without exiting the vty shell
Donatas Abraitis [Wed, 10 Aug 2022 10:43:11 +0000 (13:43 +0300)]
vtysh: Handle SIGTSTP (C-z) without exiting the vty shell

After 4c92dd90d3d15cff640de063ff14eec950402d25 switching to poll-based I/O,
vtysh prompt exits on C-z signal.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Remove unused return codes in zebra_mpls.c
Donald Sharp [Tue, 9 Aug 2022 18:12:15 +0000 (14:12 -0400)]
zebra: Remove unused return codes in zebra_mpls.c

There are some return codes for functions that
are not really used.  Clean them up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Combine meta_queue_free and meta_queue_vrf_free functions
Donald Sharp [Tue, 9 Aug 2022 17:09:16 +0000 (13:09 -0400)]
zebra: Combine meta_queue_free and meta_queue_vrf_free functions

These functions essentially do the same thing.  Combine them
for the goodness of mankind.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: System routes should be processed the same time as kernel
Donald Sharp [Tue, 9 Aug 2022 14:23:35 +0000 (10:23 -0400)]
zebra: System routes should be processed the same time as kernel

For whatever reason.  ZEBRA_ROUTE_SYSTEM routes were being processed
last.  Since a system route is just another kernel route type.  Let's
just switch it to be processed the same time as kernel routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Let's use enum for META Queue indexes
Donald Sharp [Tue, 9 Aug 2022 13:47:44 +0000 (09:47 -0400)]
zebra: Let's use enum for META Queue indexes

Convert the meta queue values to an enum and use
them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Explicitly call out the correct queue name
Donald Sharp [Tue, 9 Aug 2022 13:22:43 +0000 (09:22 -0400)]
zebra: Explicitly call out the correct queue name

There were more than a few places where the NHG meta
queue was not being explicitly called out.  Let's
be consistent and use the same nomenclature as much
as possible when talking about metaQ's.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11768 from donaldsharp/multiple_connected_installs
Donatas Abraitis [Wed, 10 Aug 2022 11:04:18 +0000 (14:04 +0300)]
Merge pull request #11768 from donaldsharp/multiple_connected_installs

zebra: Don't install connected routes multiple times into FRR

21 months agopimd, pim6d: Using ttable for displaying "show ip/ipv6 multicast count" command.
Abhishek N R [Wed, 10 Aug 2022 09:04:04 +0000 (02:04 -0700)]
pimd, pim6d: Using ttable for displaying "show ip/ipv6 multicast count" command.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agoMerge pull request #11668 from rampxxxx/bfd_rtt_in_echo_pkt
Rafael Zalamena [Tue, 9 Aug 2022 15:20:24 +0000 (15:20 +0000)]
Merge pull request #11668 from rampxxxx/bfd_rtt_in_echo_pkt

BFDD: Add RTT to BFD IPV4 Echo packet processing

21 months agoMerge pull request #11752 from opensourcerouting/fix/update_policy_on_filters
Russ White [Tue, 9 Aug 2022 12:32:33 +0000 (08:32 -0400)]
Merge pull request #11752 from opensourcerouting/fix/update_policy_on_filters

bgpd: Handle ORF remove-all events correctly and update ORF prefix-list on changes

21 months agoMerge pull request #11770 from donaldsharp/static_mpls_label_change
Russ White [Tue, 9 Aug 2022 12:23:23 +0000 (08:23 -0400)]
Merge pull request #11770 from donaldsharp/static_mpls_label_change

staticd: When changing the underlying nh ensure it is reinstalled

21 months agoMerge pull request #11765 from lyq140/patch-pimDoc
Jafar Al-Gharaibeh [Tue, 9 Aug 2022 06:12:18 +0000 (01:12 -0500)]
Merge pull request #11765 from lyq140/patch-pimDoc

doc: pimd needs linux kernel 4.19(IGMPMSG_WRVIFWHOLE)

21 months agozebra: correct one comment about ethtool ioctl
anlan_cs [Tue, 9 Aug 2022 05:06:47 +0000 (01:06 -0400)]
zebra: correct one comment about ethtool ioctl

`get_iflink_speed()` uses ioctl to get speed, not ip address. Additionally
adjust format for another one comment line.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agozebra: correct one comment for evpn-mh
anlan_cs [Tue, 9 Aug 2022 00:47:37 +0000 (20:47 -0400)]
zebra: correct one comment for evpn-mh

These moved mac addresses are actually in active status during moving
phase, just correct comment.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agodoc: pimd needs linux kernel 4.19(IGMPMSG_WRVIFWHOLE)
ron [Mon, 8 Aug 2022 07:56:58 +0000 (15:56 +0800)]
doc: pimd needs linux kernel 4.19(IGMPMSG_WRVIFWHOLE)

Signed-off-by: ron <lyq140hf2006@163.com>
21 months agoMerge pull request #11769 from opensourcerouting/fix/no_rib_implied
Donald Sharp [Mon, 8 Aug 2022 22:34:39 +0000 (18:34 -0400)]
Merge pull request #11769 from opensourcerouting/fix/no_rib_implied

bgpd: When specifying listen address for bgpd we shouldn't imply no fib flag

21 months agostaticd: When changing the underlying nh ensure it is reinstalled
Donald Sharp [Mon, 8 Aug 2022 19:41:42 +0000 (15:41 -0400)]
staticd: When changing the underlying nh ensure it is reinstalled

There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:

Example of brokenness:

eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:05 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:12 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

Fixed behavior:

eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:04 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:01 ago
  * 192.168.119.1, via enp39s0, label 16040, weight 1

I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: When specifying listen address for bgpd we shouldn't imply no fib flag
Donatas Abraitis [Mon, 8 Aug 2022 18:22:02 +0000 (21:22 +0300)]
bgpd: When specifying listen address for bgpd we shouldn't imply no fib flag

When `-l` is used, then no routes are exported to the kernel.

```
$ grep bgpd_options /etc/frr/daemons
bgpd_options="   -A 127.0.0.1 -l 127.0.0.2"
```

Before:

```
donatas-pc# sh run | include no-rib
bgp no-rib
donatas-pc#
```

After:

```
donatas-pc# sh run | include no-rib
donatas-pc#
```

Signed-off-by: Kris Shannon <k.shannon@amaze.com.au>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Don't install connected routes multiple times into FRR
Donald Sharp [Mon, 8 Aug 2022 16:32:15 +0000 (12:32 -0400)]
zebra: Don't install connected routes multiple times into FRR

When moving an interface between vrf's we do not need
to install the connected routes multiple times.

eva# show ip route vrf all
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF BLUE:
C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:10

VRF default:
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:00:10
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:10
eva# exit
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link add GREEN type vrf table 11000
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set GREEN up
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set dummy7 master GREEN
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> vtysh

Hello, this is FRRouting (version 8.4-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

eva# show ip route vrf all
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF GREEN:
C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:05

VRF default:
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:01:03
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:01:03
eva# exit
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo ip link set dummy7 nomaster
sharpd@eva ~/f/t/topotests (multiple_connected_installs)> sudo vtysh -c "show ip route vrf all"
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF default:
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:03:22
C>* 4.5.6.7/32 is directly connected, dummy7, 00:00:08
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:03:22
sharpd@eva ~/f/t/topotests (multiple_connected_installs)>
 @  11 0:-*                                                                                                                                                         5h50m 0.06 24x1.9GHz 31.4G26% 426G70% 2022-08-08 13:49:24

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11501 from donaldsharp/mpls_turns_on
Donatas Abraitis [Mon, 8 Aug 2022 16:04:49 +0000 (19:04 +0300)]
Merge pull request #11501 from donaldsharp/mpls_turns_on

Mpls turns on

21 months agotests: Convert one test to use interface based mpls config
Donald Sharp [Wed, 29 Jun 2022 17:20:11 +0000 (13:20 -0400)]
tests: Convert one test to use interface based mpls config

To prove that this works.  Modify a test that uses mpls to
turn on mpls for the interfaces that need mpls via the
new mpls command.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Add a `mpls enable` interface node command
Donald Sharp [Wed, 29 Jun 2022 11:43:50 +0000 (07:43 -0400)]
zebra: Add a `mpls enable` interface node command

Allow individual interfaces to turn on/off the mpls subsystem
for it in linux.

sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls
net.mpls.conf.enp39s0.input = 0
sharpd@eva:~/frr9$ vtysh -c "conf" -c "int enp39s0" -c "mpls enable"
sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls
net.mpls.conf.enp39s0.input = 1
sharpd@eva:~/frr9$ vtysh -c "conf" -c "int enp39s0" -c "no mpls enable"
sharpd@eva:~/frr9$ sudo sysctl -a | grep enp39s0 | grep mpls
net.mpls.conf.enp39s0.input = 0
sharpd@eva:~/frr9$

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Notice when an interface is turned on w/ mpls and enable mpls subsystem
Donald Sharp [Tue, 28 Jun 2022 18:58:55 +0000 (14:58 -0400)]
zebra: Notice when an interface is turned on w/ mpls and enable mpls subsystem

Currently when FRR starts up it queries the kernel to see if mpls is turned on.
If not FRR does not enable zebra's mpls subsection.  If at a later time mpls
is turned on, let's notice that an interface now is enabled for mpls( thus
implying that all the bits and bobs in the kernel are now setup properly ).

a) convert mpls_enabled to a bool
b) abstract a new function zebra_mpls_turned_on and call it
when FRR notices that an interface now has mpls enabled.
c) mpls_processq_init cannot fail, so actually notice that
and don't have special code to detect a failure.

New results:

sharpd@eva ~> vtysh -c "show zebra"
 OS                           Linux(5.10.0-12-amd64)
 ECMP Maximum                 128
 v4 Forwarding                On
 v6 Forwarding                On
 MPLS                         Off
 EVPN                         Off
 Kernel socket buffer size    90000000
 VRF                          l3mdev Available
 ASIC offload                 Unavailable
 RA                           Compiled in
 RFC 5549                     BGP is not using
 Kernel NHG                   Available
 v4 All LinkDown Routes       Off
 v4 Default LinkDown Routes   Off
 v6 All LinkDown Routes       Off
 v6 Default LinkDown Routes   Off
 v4 All MC Forwarding         On
 v4 Default MC Forwarding     Off
 v6 All MC Forwarding         On
 v6 Default MC Forwarding     Off

                            Route      Route      Neighbor   LSP        LSP
VRF                         Installs   Removals    Updates   Installs   Removals
default                           26          7          0          0          0
<turn on mpls_iptunnel and mpls_router modules in the kernel and then do this>:
sharpd@eva ~> sudo sysctl -w net.mpls.conf.enp39s0.input=1
[sudo] password for sharpd:
net.mpls.conf.enp39s0.input = 1
sharpd@eva ~> vtysh -c "show zebra"
 OS                           Linux(5.10.0-12-amd64)
 ECMP Maximum                 128
 v4 Forwarding                On
 v6 Forwarding                On
 MPLS                         On
 EVPN                         Off
 Kernel socket buffer size    90000000
 VRF                          l3mdev Available
 ASIC offload                 Unavailable
 RA                           Compiled in
 RFC 5549                     BGP is not using
 Kernel NHG                   Available
 v4 All LinkDown Routes       Off
 v4 Default LinkDown Routes   Off
 v6 All LinkDown Routes       Off
 v6 Default LinkDown Routes   Off
 v4 All MC Forwarding         On
 v4 Default MC Forwarding     Off
 v6 All MC Forwarding         On
 v6 Default MC Forwarding     Off

                            Route      Route      Neighbor   LSP        LSP
VRF                         Installs   Removals    Updates   Installs   Removals
default                           26          7          0          0          0
sharpd@eva ~>

I am doing this work because FRR keeps having operators not know about how
to properly use mpls.  Let's make FRR behave a bit better in this weird edge
case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Add IF_ZEBRA_DATA_X define
Donald Sharp [Wed, 29 Jun 2022 13:05:17 +0000 (09:05 -0400)]
zebra: Add IF_ZEBRA_DATA_X define

There are 2 defines IF_ZEBRA_MULTICAST_X and
IF_ZEBRA_SHUTDOWN_X macros that do the same
thing.  Combine into one.

Future commits will use the IF_ZEBRA_DATA_X macro
as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Cleanup unguarded debug
Donald Sharp [Wed, 29 Jun 2022 17:13:10 +0000 (13:13 -0400)]
zebra: Cleanup unguarded debug

Left over debug from earlier commits

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11766 from liwg06/master
Donatas Abraitis [Mon, 8 Aug 2022 11:55:42 +0000 (14:55 +0300)]
Merge pull request #11766 from liwg06/master

lib: Remove invalid function declaration

21 months agolib: Remove invalid function declaration
Weiguo Li [Mon, 8 Aug 2022 09:20:52 +0000 (17:20 +0800)]
lib: Remove invalid function declaration

there is no definition of ttable_cell_del(), thus remove its declaration.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
21 months agoMerge pull request #11750 from AbhishekNR/debug_msdp
Donatas Abraitis [Mon, 8 Aug 2022 08:05:22 +0000 (11:05 +0300)]
Merge pull request #11750 from AbhishekNR/debug_msdp

pim6d: Removing the temporary enabled debugs.

21 months agoMerge pull request #11623 from taspelund/prefer_mp_nexthop
Donatas Abraitis [Mon, 8 Aug 2022 07:18:57 +0000 (10:18 +0300)]
Merge pull request #11623 from taspelund/prefer_mp_nexthop

bgpd: ignore NEXT_HOP for MP_REACH_NLRI

21 months agoMerge pull request #11720 from SaiGomathiN/pimv6debugfix
Donatas Abraitis [Mon, 8 Aug 2022 07:11:38 +0000 (10:11 +0300)]
Merge pull request #11720 from SaiGomathiN/pimv6debugfix

pim6d: Add 'show debugging [pimv6]' CLI and some fixes

21 months agoMerge pull request #11759 from donaldsharp/bfd_noarp
Donatas Abraitis [Mon, 8 Aug 2022 07:10:13 +0000 (10:10 +0300)]
Merge pull request #11759 from donaldsharp/bfd_noarp

bfdd: Some interfaces don't have mac addresses

21 months agopim6d: Removing the temporary enabled debugs.
Abhishek N R [Fri, 5 Aug 2022 10:20:16 +0000 (03:20 -0700)]
pim6d: Removing the temporary enabled debugs.

Debug pimv6 cli's are implemented.
Therefore removing this.

Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agoMerge pull request #11751 from donaldsharp/pim6d_tools_fixup
mobash-rasool [Sat, 6 Aug 2022 14:51:20 +0000 (20:21 +0530)]
Merge pull request #11751 from donaldsharp/pim6d_tools_fixup

tools: Add pim6d to tools so that pim6d will work properly

21 months agobfdd: Some interfaces don't have mac addresses
Donald Sharp [Sat, 6 Aug 2022 01:40:11 +0000 (21:40 -0400)]
bfdd: Some interfaces don't have mac addresses

When an interface does not have a mac address, don't
try to retrieve the mac address ( for it to just fail ).

Example interface:
sharpd@eva [2]> ip link show tun100
21: tun100@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ipip 192.168.119.224 peer 192.168.119.120

Let's just notice that there is a NOARP flag and abort the call.

Fixes: #11733
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotools: Add pim6d to tools so that pim6d will work properly
Donald Sharp [Fri, 5 Aug 2022 12:14:06 +0000 (08:14 -0400)]
tools: Add pim6d to tools so that pim6d will work properly

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #11744 from donaldsharp/nhgs
Donatas Abraitis [Sat, 6 Aug 2022 11:58:57 +0000 (14:58 +0300)]
Merge pull request #11744 from donaldsharp/nhgs

NHGs Various Fixes