]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agozebra: cleanup protodown netlink logs
Stephen Worley [Tue, 15 Feb 2022 23:53:01 +0000 (18:53 -0500)]
zebra: cleanup protodown netlink logs

Cleanup the logs in the netlink code for setting
protodown on/off to be more useful to a user parsing them
after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: use SET/UNSET/CHECK/COND in protodown code
Stephen Worley [Tue, 15 Feb 2022 23:21:18 +0000 (18:21 -0500)]
zebra: use SET/UNSET/CHECK/COND in protodown code

Use the SET/UNSET/CHECK/COND macros for flag bifields
where appropriate throught the protodown code base.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: include old reason in evpn-mh bond update
Stephen Worley [Tue, 15 Feb 2022 23:42:41 +0000 (18:42 -0500)]
zebra: include old reason in evpn-mh bond update

Ensure we include the old reason when we are updating the reason
code for a evpn-mh bond member. Now that this is a common API
it could include things external to EVPN in this reason code
bitfield (ex: vrrp).

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: make netlink protodown func more readable
Stephen Worley [Tue, 15 Feb 2022 22:56:50 +0000 (17:56 -0500)]
zebra: make netlink protodown func more readable

Make the netlink protodown static function for checking
if the only bit set for protodown reason is FRR's more
easily readable to someone not familiar with the code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: clear dplane flags on failure for protodown
Stephen Worley [Tue, 15 Feb 2022 22:51:36 +0000 (17:51 -0500)]
zebra: clear dplane flags on failure for protodown

Make sure we clear our dplane flags for SET/UNSET
on failure so that we try again.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: simplify reason code printing in show
Stephen Worley [Tue, 15 Feb 2022 22:46:05 +0000 (17:46 -0500)]
zebra: simplify reason code printing in show

Simplify the code for printing the reason codes via
show command. Just remove the trailing comma last
before printing.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: cleanup protodown api logs
Stephen Worley [Tue, 15 Feb 2022 19:22:50 +0000 (14:22 -0500)]
zebra: cleanup protodown api logs

Cleanup the logs in the api for setting protodown on/off
that zapi and others use. Make them more useful to a user parsing
them after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: wrap macro zif argument in parans
Stephen Worley [Tue, 15 Feb 2022 19:08:06 +0000 (14:08 -0500)]
zebra: wrap macro zif argument in parans

Missing parenthesis for macro ZIF argument.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: avoid initialization in ctx_intf_init
Stephen Worley [Tue, 15 Feb 2022 19:05:10 +0000 (14:05 -0500)]
zebra: avoid initialization in ctx_intf_init

Avoid initialization in dplane_ctx_intf_init() so
the compiler can warn us about using unintialized data.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: evpn-mh bonds protodown check for set
Stephen Worley [Tue, 15 Feb 2022 17:36:18 +0000 (12:36 -0500)]
zebra: evpn-mh bonds protodown check for set

When we are processing a bond member's protodown we get from
the dataplane, check to make sure we haven't already queued
up a set. If we have, it's likely this is just a notification
we get from the kernel after we set protodown and before we have
processed the result in our dplane pthread.

This change is needed now that we set protodown via the dplane
pthread.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: evpn-mh use protodown update reason api
Stephen Worley [Tue, 15 Feb 2022 17:35:02 +0000 (12:35 -0500)]
zebra: evpn-mh use protodown update reason api

When setting the protodown reason use the update api
where we can directly update the entire reason bitfield
since we have to set more than one.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: extern setting protodown reason directly
Stephen Worley [Tue, 15 Feb 2022 17:33:06 +0000 (12:33 -0500)]
zebra: extern setting protodown reason directly

Extern the api for setting the protodown reason code
bitfield directly. Some places may want to completely update the
bitfield with more than one reason at a time.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: only clear pd_reason on shutdown/sweep
Stephen Worley [Mon, 31 Jan 2022 21:12:01 +0000 (16:12 -0500)]
zebra: only clear pd_reason on shutdown/sweep

Only clear protodown reason on shutdown/sweep, retain protodown
state.

This is to retain traditional and expected behavior with daemons
like vrrpd setting protodown. They expet it to be set on shutdown
and retained on bring up to prevent traffic from being dropped.

We must cleanup our reason code though to prevent us from blocking
others.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: add boilerplate protodown updates for *bsd
Stephen Worley [Wed, 26 Jan 2022 06:10:43 +0000 (01:10 -0500)]
zebra: add boilerplate protodown updates for *bsd

Add boilerplate for someone to come and add protdown updates
for bsd platforms if it ever exists.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agodoc: add user doc for sharp protodown
Stephen Worley [Wed, 26 Jan 2022 04:41:11 +0000 (23:41 -0500)]
doc: add user doc for sharp protodown

Add user doc for setting protodown on an interface with
sharpd.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agotests: add protodown topotest using sharpd
Stephen Worley [Wed, 26 Jan 2022 03:57:03 +0000 (22:57 -0500)]
tests: add protodown topotest using sharpd

Add a protodown topotest using sharpd.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: remove old protodown dplane path
Stephen Worley [Tue, 25 Jan 2022 19:49:01 +0000 (14:49 -0500)]
zebra: remove old protodown dplane path

Remove the old protodown dplane path install on the main thread.
This is now dead code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: use a macro for check protodown
Stephen Worley [Tue, 25 Jan 2022 19:44:25 +0000 (14:44 -0500)]
zebra: use a macro for check protodown

Add a helper macro for checking if interface is protodown,
typing this out is annoying.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: clear protodown_rc on shutdown and sweep
Stephen Worley [Tue, 25 Jan 2022 18:49:05 +0000 (13:49 -0500)]
zebra: clear protodown_rc on shutdown and sweep

Add functionality to clear any reason code set on shutdown
of zebra when we are freeing the interface, in case a bad
client didn't tell us to clear it when the shutdown.

Also, in case of a crash or failure to do the above, clear reason
on startup if it is set.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: add enum set/unset states for queing
Stephen Worley [Fri, 21 Jan 2022 09:03:01 +0000 (04:03 -0500)]
zebra: add enum set/unset states for queing

Add enums for set/unset of prodown state to handle the mainthread
knowing an update is already queued without actually marking it
as complete.

This is to make the logic confirm a bit more with other parts of the code
where we queue dplane updates and not update our internal structs until
success callback is received.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: add command for setting protodown bit
Stephen Worley [Wed, 19 Jan 2022 19:36:10 +0000 (14:36 -0500)]
zebra: add command for setting protodown bit

Add command for use to set protodown via frr.conf in
the case our default conflicts with another application
they are using.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agosharpd: add support for setting protodown
Stephen Worley [Wed, 26 Jan 2022 05:23:07 +0000 (00:23 -0500)]
sharpd: add support for setting protodown

Add support for setting protodown via sharpd. This is just useful
for testing. We can make use of this in topotests.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agozebra: add support for protodown reason code
Stephen Worley [Wed, 26 Jan 2022 05:07:57 +0000 (00:07 -0500)]
zebra: add support for protodown reason code

Add support for setting the protodown reason code.

https://github.com/torvalds/linux/commit/829eb208e80d6db95c0201cb8fa00c2f9ad87faf

These patches handle all our netlink code for setting the reason.

For protodown reason we only set `frr` as the reason externally
but internally we have more descriptive reasoning available via
`show interface IFNAME`. The kernel only provides a bitwidth of 32
that all userspace programs have to share so this makes the most sense.

Since this is new functionality, it needs to be added to the dplane
pthread instead. So these patches, also move the protodown setting we
were doing before into the dplane pthread. For this, we abstract it a
bit more to make it a general interface LINK update dplane API. This
API can be expanded to support gernal link creation/updating when/if
someone ever adds that code.

We also move a more common entrypoint for evpn-mh and from zapi clients
like vrrpd. They both call common code now to set our internal flags
for protodown and protodown reason.

Also add debugging code for dumping netlink packets with
protodown/protodown_reason.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agoinclude: bump if_netlink.h version for protodown
Stephen Worley [Wed, 26 Jan 2022 05:01:08 +0000 (00:01 -0500)]
include: bump if_netlink.h version for protodown

Bump if_netlink.h UAPI files for protodown netlink
processing.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agoMerge pull request #10662 from chiragshah6/evpn_dev1
Russ White [Wed, 9 Mar 2022 21:37:30 +0000 (16:37 -0500)]
Merge pull request #10662 from chiragshah6/evpn_dev1

zebra: netlink protodown event handling for vxlan device

2 years agoMerge pull request #10694 from opensourcerouting/pim6-nht-reenable
Donald Sharp [Wed, 9 Mar 2022 16:51:18 +0000 (11:51 -0500)]
Merge pull request #10694 from opensourcerouting/pim6-nht-reenable

pim6d: reenable NHT code

2 years agoMerge pull request #10635 from anlancs/staticd-cross
Mark Stapp [Wed, 9 Mar 2022 16:05:59 +0000 (11:05 -0500)]
Merge pull request #10635 from anlancs/staticd-cross

zebra: let same host route cross VRF

2 years agoMerge pull request #10079 from mjstapp/fix_intf_del_nhgs
David Lamparter [Wed, 9 Mar 2022 09:15:00 +0000 (10:15 +0100)]
Merge pull request #10079 from mjstapp/fix_intf_del_nhgs

2 years agozebra: let /32 host route with same IP cross VRF
anlan_cs [Mon, 31 Jan 2022 00:44:35 +0000 (19:44 -0500)]
zebra: let /32 host route with same IP cross VRF

Contraints of host routes are too strict in current code:
Host routes with same destination address and nexthop address are forbidden
even when cross VRFs.

Currently host routes with different destination and nexthop address can cross
VRFs, it is ok. But host routes with same addresses are forbidden to cross VRFs,
it is wrong.

Since different VRFs can have the same addresses, leak specific host route with
the same nexthop address ( it means destination address is same to nexthop
address ) to other VRFs is a normal case.

This commit relaxes that contraints. Host routes with same destination address
and nexthop address are forbidden only when not cross VRFs.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agozebra: shutdown doesn't uninstall zebra's NHGs
Mark Stapp [Tue, 16 Nov 2021 18:38:31 +0000 (13:38 -0500)]
zebra: shutdown doesn't uninstall zebra's NHGs

When an interface goes down, it signals any related NHGs to
re-validate themselves. During zebra shutdown, ensure we remove
any NHGs we've installed.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10701 from rampxxxx/feat_isis_json_show_cmds
Russ White [Tue, 8 Mar 2022 16:15:25 +0000 (11:15 -0500)]
Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmds

Feat isis json show cmds

2 years agoMerge pull request #10722 from chiragshah6/evpn_dev3
Russ White [Tue, 8 Mar 2022 16:00:29 +0000 (11:00 -0500)]
Merge pull request #10722 from chiragshah6/evpn_dev3

zebra: fix crash in evpn neigh cleanup all

2 years agoMerge pull request #10646 from mobash-rasool/pim-rp-changes-new
David Lamparter [Tue, 8 Mar 2022 11:26:37 +0000 (12:26 +0100)]
Merge pull request #10646 from mobash-rasool/pim-rp-changes-new

2 years agoMerge pull request #10754 from mobash-rasool/yang-fix
David Lamparter [Tue, 8 Mar 2022 11:24:16 +0000 (12:24 +0100)]
Merge pull request #10754 from mobash-rasool/yang-fix

2 years agopim6d: Modify apis in pim_rpf.c for PIMv4/PIMv6
Mobashshera Rasool [Mon, 21 Feb 2022 18:20:05 +0000 (10:20 -0800)]
pim6d: Modify apis in pim_rpf.c for PIMv4/PIMv6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_find_exact and pim_rp_find_match_group
Mobashshera Rasool [Mon, 21 Feb 2022 13:47:08 +0000 (05:47 -0800)]
pim6d: Modify pim_rp_find_exact and pim_rp_find_match_group

Modify the apis to accomodate IPv4 and IPv6 addreses for RP.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_del for PIMv4/PIMv6
Mobashshera Rasool [Mon, 21 Feb 2022 13:44:04 +0000 (05:44 -0800)]
pim6d: Modify pim_rp_del for PIMv4/PIMv6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_find_prefix_list for PIMv6
Mobashshera Rasool [Mon, 21 Feb 2022 13:23:15 +0000 (05:23 -0800)]
pim6d: Modify pim_rp_find_prefix_list for PIMv6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_g for PIMv4/PIMv6
Mobashshera Rasool [Mon, 21 Feb 2022 11:27:35 +0000 (03:27 -0800)]
pim6d: Modify pim_rp_g for PIMv4/PIMv6

Modify pim_rp_g to support PIMv6.
Remove it from stub.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_i_am_rp for PIMv4/PIMv6
Mobashshera Rasool [Mon, 21 Feb 2022 11:21:48 +0000 (03:21 -0800)]
pim6d: Modify pim_rp_i_am_rp for PIMv4/PIMv6

Remove pim_rp_i_am_rp from stub for PIMv6.
Modify pim_rp_i_am_rp for both the daemons.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_set_upstream_addr for PIMv4/PIMv6
Mobashshera Rasool [Thu, 17 Feb 2022 18:54:47 +0000 (10:54 -0800)]
pim6d: Modify pim_rp_set_upstream_addr for PIMv4/PIMv6

Modify pim_rp_set_upstream_addr for supporting PIMv4 and PIMv6.
Removed the stub api for PIMv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Add pim_get_all_mcast_group api
Mobashshera Rasool [Thu, 17 Feb 2022 11:56:20 +0000 (03:56 -0800)]
pim6d: Add pim_get_all_mcast_group api

Added this api to fill all multicast group address based on IP version.
For PIMv4 its 224.0.0.0/4, for PIMv6 its FF00::0/8.
Changed the code where its being used currently.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_change api for pimv6
Mobashshera Rasool [Thu, 3 Feb 2022 11:31:54 +0000 (03:31 -0800)]
pim6d: Modify pim_rp_change api for pimv6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Convert %s to %pPA for RP Addresses
Mobashshera Rasool [Wed, 16 Feb 2022 08:04:13 +0000 (00:04 -0800)]
pim6d: Convert %s to %pPA for RP Addresses

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_*_cmd_worker api passing pim_addr parameter
Mobashshera Rasool [Thu, 3 Feb 2022 09:38:54 +0000 (01:38 -0800)]
pim6d: Modify pim_*_cmd_worker api passing pim_addr parameter

Pass pim_addr as parameter for rp address to accomodate ipv6.
Modifying pim_rp_cmd_worker and pim_no_rp_cmd_worker function
parameters from in_addr to pim_addr.
Changes in the caller functions are done as well to make it work
for IPv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify pim_rp_new for pimv6
Mobashshera Rasool [Wed, 2 Feb 2022 15:00:50 +0000 (07:00 -0800)]
pim6d: Modify pim_rp_new for pimv6

Modify the api pim_rp_new to accomodate pimv6 changes.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Return type and parameter changes for api pim_rp_del_config
Mobashshera Rasool [Wed, 2 Feb 2022 15:36:47 +0000 (07:36 -0800)]
pim6d: Return type and parameter changes for api pim_rp_del_config

1. Return value of this function pim_rp_del_config is nowhere used.
So made it as a void function.
2. Paramater const char *rp is first converted to string from prefix
in the caller and then back to prefix in this api pim_rp_del_config.
Fixed it by directly passing the address instead of string.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Stub BSM related APIs for compilation
Mobashshera Rasool [Mon, 28 Feb 2022 19:12:03 +0000 (11:12 -0800)]
pim6d: Stub BSM related APIs for compilation

Have stubbed few of the BSM related APIs to keep
PIMv6 compiling.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Add northbound changes for static rp
Mobashshera Rasool [Tue, 25 Jan 2022 11:19:22 +0000 (03:19 -0800)]
pim6d: Add northbound changes for static rp

Parsing the inputs for static RP configuration.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding the rp clis to show-running
Mobashshera Rasool [Mon, 7 Mar 2022 07:34:19 +0000 (23:34 -0800)]
pim6d: Adding the rp clis to show-running

Modify the pim_rp_config_write api for pimv4/pimv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding "ipv6 pim rp <> prefix-list <>" cli to pimv6
Mobashshera Rasool [Mon, 7 Mar 2022 07:26:53 +0000 (23:26 -0800)]
pim6d: Adding "ipv6 pim rp <> prefix-list <>" cli to pimv6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Add static RP CLI for PIMv6
Mobashshera Rasool [Tue, 25 Jan 2022 10:49:10 +0000 (02:49 -0800)]
pim6d: Add static RP CLI for PIMv6

Added the CLI to configure static RP configuration.
[no] ipv6 pim rp <rp-addr> [<group-addr/M>]

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modify "ip pim rp <> prefix-list <>" command
Mobashshera Rasool [Mon, 7 Mar 2022 07:18:47 +0000 (23:18 -0800)]
pimd: Modify "ip pim rp <> prefix-list <>" command

1. Moving the processing of the above command to an api.
2. Change DEFUN to DEPFY
3. Make the api common for pimv4 and pimv6 processing.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Modify apis pim_process_rp_cmd for common processing
Mobashshera Rasool [Mon, 7 Mar 2022 06:46:10 +0000 (22:46 -0800)]
pim6d: Modify apis pim_process_rp_cmd for common processing

Modify the apis pim_process_rp_cmd and pim_process_no_rp_cmd
to accomodate ipv4 as well as ipv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Moving processing of "ip pim rp <grp>" cmd to a common api
Mobashshera Rasool [Mon, 7 Mar 2022 06:02:10 +0000 (22:02 -0800)]
pimd: Moving processing of "ip pim rp <grp>" cmd to a common api

1. Moving the processing of the command to a common api.
2. Changing the DEFUN to DEFPY.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10393 from patrasar/master_pimv6_cli
David Lamparter [Tue, 8 Mar 2022 08:46:31 +0000 (09:46 +0100)]
Merge pull request #10393 from patrasar/master_pimv6_cli

2 years agoMerge pull request #10753 from mobash-rasool/pimv6-fixes
David Lamparter [Tue, 8 Mar 2022 08:42:28 +0000 (09:42 +0100)]
Merge pull request #10753 from mobash-rasool/pimv6-fixes

2 years agoyang: Fix the ipv6 multicast pattern in frr-route-types
Mobashshera Rasool [Tue, 8 Mar 2022 07:40:02 +0000 (23:40 -0800)]
yang: Fix the ipv6 multicast pattern in frr-route-types

The pattern defined for ipv6-multicast-group-prefix is wrong.
This is leading to mismatch for all the valid ipv6 multicast
addresses.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Initialise VRF related stuffs in Northbound
Mobashshera Rasool [Tue, 8 Mar 2022 05:18:53 +0000 (21:18 -0800)]
pim6d: Initialise VRF related stuffs in Northbound

Not initialising it will lead to crash in nb_running_get_entry_worker.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Remove duplicate if_cmd_init
Mobashshera Rasool [Tue, 8 Mar 2022 05:17:20 +0000 (21:17 -0800)]
pim6d: Remove duplicate if_cmd_init

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10748 from opensourcerouting/unused-20220307
Donald Sharp [Tue, 8 Mar 2022 00:33:26 +0000 (19:33 -0500)]
Merge pull request #10748 from opensourcerouting/unused-20220307

zebra: remove unused variable

2 years agoMerge pull request #10747 from donaldsharp/reported_code_indentation
Jafar Al-Gharaibeh [Mon, 7 Mar 2022 19:21:33 +0000 (13:21 -0600)]
Merge pull request #10747 from donaldsharp/reported_code_indentation

bgpd: Fix continue/break change from old commit

2 years agoMerge pull request #10741 from LabNConsulting/chopps/critfixgrpc
Donald Sharp [Mon, 7 Mar 2022 16:49:48 +0000 (11:49 -0500)]
Merge pull request #10741 from LabNConsulting/chopps/critfixgrpc

critical fixes for grpc

2 years agozebra: remove unused variable
David Lamparter [Mon, 7 Mar 2022 16:36:00 +0000 (17:36 +0100)]
zebra: remove unused variable

clang complains "variable 'curr_length' set but not used".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: Fix continue/break change from old commit
Donald Sharp [Mon, 7 Mar 2022 16:28:28 +0000 (11:28 -0500)]
bgpd: Fix continue/break change from old commit

Commit: ea47320b1d0eeaa56f945fa356da7e4ca7f2b0b2

Modified the bgp_clear_stale_route function to have
better indentation, but in the process changed some
`continue;` statements to `break;` which modified
the looping and caused stale paths to not always be
removed upon an update.

To reproduce:  A ---- B, setup with addpath and GR
One side has a prefix with nhop1 and nhop2, kill one
side and then resend the same prefix with nhop3,
paths nhop1 and 2 become stale and never removed.

Code inspection clearly shows that that `continue`
statements became `break` statements causing the
loop over all paths to stop prematurely.

The fix is to change the break back to continue
statements so the loop can continue instead of
stopping.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10745 from mjstapp/fix_doc_star_again
Donatas Abraitis [Mon, 7 Mar 2022 15:37:35 +0000 (17:37 +0200)]
Merge pull request #10745 from mjstapp/fix_doc_star_again

doc: fix another doc typo

2 years agodoc: fix another doc typo
Mark Stapp [Mon, 7 Mar 2022 13:34:09 +0000 (08:34 -0500)]
doc: fix another doc typo

Fix another typo that mis-uses the asterisk character.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10732 from anlancs/zebra-minor-move
Donatas Abraitis [Mon, 7 Mar 2022 10:15:43 +0000 (12:15 +0200)]
Merge pull request #10732 from anlancs/zebra-minor-move

zebra: Delay the usage of one variable

2 years agolib: grpc: fix handling of "empty" yang type
Christian Hopps [Sun, 6 Mar 2022 16:58:26 +0000 (11:58 -0500)]
lib: grpc: fix handling of "empty" yang type

- rather than coerce `const char *` to std:string&, just pass the
C ptr, as that's what is used anyway.

fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agolib: grpc: fix shutdown code
Christian Hopps [Sat, 5 Mar 2022 16:04:43 +0000 (11:04 -0500)]
lib: grpc: fix shutdown code

fixes #9732

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agolib: grpc: initialize uninitialized member variables
Christian Hopps [Sat, 26 Feb 2022 12:55:32 +0000 (07:55 -0500)]
lib: grpc: initialize uninitialized member variables

fixes #9732, fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agolib: grpc: do not remove candidate entry too soon
Christian Hopps [Sun, 6 Mar 2022 11:58:22 +0000 (06:58 -0500)]
lib: grpc: do not remove candidate entry too soon

Fix from Rafael Zalamena <rzalamena@opensourcerouting.org>

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agolib: tweak northbound gRPC default timeout
Rafael Zalamena [Mon, 21 Feb 2022 11:28:11 +0000 (06:28 -0500)]
lib: tweak northbound gRPC default timeout

Don't let open sockets hang for too long. This will fix an issue where a
improperly coded client (e.g. socat) could exaust the amount of open
file descriptors.

Documentation:
https://grpc.github.io/grpc/cpp/md_doc_keepalive.html

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agoMerge pull request #10734 from ton31337/fix/rpki_read
Jafar Al-Gharaibeh [Sat, 5 Mar 2022 07:55:53 +0000 (01:55 -0600)]
Merge pull request #10734 from ton31337/fix/rpki_read

bgpd: Fix while(read()) for RPKI sync callback

2 years agozebra: Delay the usage of one variable until need
anlan_cs [Mon, 7 Feb 2022 04:47:49 +0000 (23:47 -0500)]
zebra: Delay the usage of one variable until need

In the loop, local variable `ip` is always set even if the check condition
is not satisfied.

Avoid the redundant set, move this set exactly after the check condition is
satisfied. Set `ip` only if the check condition is met, otherwise needn't.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: Fix while(read()) for RPKI sync callback
Donatas Abraitis [Fri, 4 Mar 2022 21:36:34 +0000 (23:36 +0200)]
bgpd: Fix while(read()) for RPKI sync callback

Bad formatting applied and it worked with small amount of prefixes (lurking).

With full BGP feed and full RPKI table, this causes infinity loop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #10730 from mobash-rasool/fixes
Donald Sharp [Fri, 4 Mar 2022 13:27:11 +0000 (08:27 -0500)]
Merge pull request #10730 from mobash-rasool/fixes

lib: Route-map failed for OSPF routes even for matching prefixes

2 years agolib: Route-map failed for OSPF routes even for matching prefixes
Mobashshera Rasool [Fri, 4 Mar 2022 09:21:48 +0000 (01:21 -0800)]
lib: Route-map failed for OSPF routes even for matching prefixes

This issue is applicable to other protocols as well.
When user has used route-map, even though the prefixes are falling
under the permit rule, the prefixes were denied and were shown
as inactive route in zebra.

Reason being the parameter which is of type enum was passed to the api
route_map_get_index and was typecasted to uint8_t *.
This problem is visible in case of Big Endian systems because we are
accessing the most significant byte.

'match_ret' field is an enum in the caller and so it is of 4 bytes,
the typecasting it to 1 byte and passing it to the api made
the api to put the value in the most significant byte
which was already zero previously. Therefore the actual value
RMAP_NOMATCH which was 1 never gets reset in this case.
Therefore the api always returns 'RMAP_NOMATCH' and hence
the prefixes are always denied.

Fixes: #9782
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10723 from opensourcerouting/bgpd-show-flow-detail
Jafar Al-Gharaibeh [Fri, 4 Mar 2022 05:11:32 +0000 (23:11 -0600)]
Merge pull request #10723 from opensourcerouting/bgpd-show-flow-detail

bgpd: fix 'show bgp detail json' output

2 years agozebra: fix crash in evpn neigh cleanup all
Chirag Shah [Thu, 4 Jun 2020 16:41:31 +0000 (09:41 -0700)]
zebra: fix crash in evpn neigh cleanup all

zebra crash is seen during shutdown (frr restart).

During shutdown, remote neigh and remote mac clean up
is triggered first, followed by per vni all neigh
(including local) and macs cleanup is triggered.

The crash occurs when a remote mac is cleaned up first
and its reference is remained in local neigh.
When local neigh attempt removes itself from its associated
mac's neigh_list it triggers inaccessible memory crash.

The fix is during mac deletion if its neigh_list is non-empty
then retain the MAC in AUTO state.
This can arise when MAC and neigh duo are in different state
(remote/local). Otherwise, the order of cleanup operation
is neighs followed by macs.

The auto mac will be cleaned up when per vni all neighs and macs
are cleaned up.

Ticket:CM-29826
Reviewed By:CCR-10369
Testing Done:

Configure evpn symmetric config where
MAC is in remote state and neigh is in local state.
Perform frr restart then crash is not seen.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 years agobgpd: fix 'show bgp detail json' output
Rafael Zalamena [Tue, 23 Nov 2021 16:28:28 +0000 (13:28 -0300)]
bgpd: fix 'show bgp detail json' output

Include the BGP_SHOW_OPT_DETAIL flag in the 'detail' version of the
command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agozebra: Prevent installation of connected multiple times
Donald Sharp [Fri, 2 Oct 2020 18:49:09 +0000 (14:49 -0400)]
zebra: Prevent installation of connected multiple times

With recent changes to interface up mechanics in if_netlink.c
FRR was receiving as many as 4 up events for an interface
on ifdown/ifup events.  This was causing timing issues
in FRR based upon some fun timings.  Remove this from
happening.

Ticket: CM-31623
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: protodown-up event trigger interface up
Chirag Shah [Mon, 14 Sep 2020 18:39:53 +0000 (11:39 -0700)]
zebra: protodown-up event trigger interface up

Vxlan interfaces flap (protodown/up) event,
non ptm operative interfaces do not come up
as protodown up event do not trigger "if_up()"
event.

Ticket:CM-30477
Reviewed By:CCR-10681
Testing Done:

validated interfaces flaps, ip link down, ifdown
and protodown followed by UP event. all Vxlan interfaces
come up in bgpd post flap.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 years agozebra: handle protodown netlink for vxlan device
Chirag Shah [Thu, 28 May 2020 18:40:29 +0000 (11:40 -0700)]
zebra: handle protodown netlink for vxlan device

Frr need to handle protocol down event for vxlan
interface.
In MLAG scenario, one of the pair switch can put
vxlan port to protodown state, followed by
tunnel-ip change from anycast IP to individual IP.

In absence of protodown handling, evpn end up
advertising locally learn EVPN (MAC-IP) routes
with individual IP as nexthop.
This leads an issue of overwriting locally learn
entries as remote on MLAG pair.

Ticket:CM-24545
Reviewed By:CCR-10310
Testing Done:

In EVPN deployment, restart one of the MLAG
daemon, which puts vxlan interfaces in protodown state.
FRR treats protodown as oper down for vxlan interfaces.
VNI down cleans up/withdraws locally learn routes.
Followed by vxlan device UP event, re-advertise
locally learn routes.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 years agoMerge pull request #10713 from donaldsharp/enum_fixup
Jafar Al-Gharaibeh [Wed, 2 Mar 2022 22:29:46 +0000 (16:29 -0600)]
Merge pull request #10713 from donaldsharp/enum_fixup

lib, ospfd: Enum fixup

2 years agotopotest: Add test for isis json cmds.
Javier Garcia [Fri, 25 Feb 2022 11:10:54 +0000 (12:10 +0100)]
topotest: Add test for isis json cmds.

Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2 years agoisisd: Add json to show isis database command.
Javier Garcia [Thu, 24 Feb 2022 10:31:18 +0000 (11:31 +0100)]
isisd: Add json to show isis database command.

Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2 years agolib: Fix zclient.c `enum event` to `enum zclient_event`
Donald Sharp [Wed, 2 Mar 2022 14:19:05 +0000 (09:19 -0500)]
lib: Fix zclient.c `enum event` to `enum zclient_event`

zclient.c is using `enum event` let's rename it to a better
named data structure `enum zclient_event`.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Convert `enum event` to `enum ospf_apiserver_event`
Donald Sharp [Tue, 1 Mar 2022 22:12:25 +0000 (17:12 -0500)]
ospfd: Convert `enum event` to `enum ospf_apiserver_event`

Let's name this something more appropriate to
what is being done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Rename `enum event` to `enum vty_event`
Donald Sharp [Mon, 28 Feb 2022 16:49:43 +0000 (11:49 -0500)]
lib: Rename `enum event` to `enum vty_event`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopim6d: reenable NHT code
David Lamparter [Tue, 1 Mar 2022 09:57:42 +0000 (10:57 +0100)]
pim6d: reenable NHT code

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopim6d: fixup NHT code for IPv6
David Lamparter [Tue, 1 Mar 2022 09:57:58 +0000 (10:57 +0100)]
pim6d: fixup NHT code for IPv6

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10657 from patrasar/pim_remove_in_addr_none
David Lamparter [Wed, 2 Mar 2022 09:42:17 +0000 (10:42 +0100)]
Merge pull request #10657 from patrasar/pim_remove_in_addr_none

[manual merge to edit comment, didn't want to incur another cycle]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: fix stray comment referencing INADDR_NONE
David Lamparter [Wed, 2 Mar 2022 09:41:22 +0000 (10:41 +0100)]
pimd: fix stray comment referencing INADDR_NONE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10684 from mobash-rasool/join-prune
David Lamparter [Wed, 2 Mar 2022 08:29:02 +0000 (09:29 +0100)]
Merge pull request #10684 from mobash-rasool/join-prune

2 years agoMerge pull request #10652 from mobash-rasool/fixes
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 19:31:49 +0000 (13:31 -0600)]
Merge pull request #10652 from mobash-rasool/fixes

pimd: FRR drops IGMP packets for TOS value other than 0XC0

2 years agoMerge pull request #10697 from donaldsharp/free_bsd_clock_gettime
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 18:48:47 +0000 (12:48 -0600)]
Merge pull request #10697 from donaldsharp/free_bsd_clock_gettime

lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backā€¦

2 years agopimd: replace inaddr_none with PIMADDR_ANY
sarita patra [Fri, 25 Feb 2022 13:17:08 +0000 (05:17 -0800)]
pimd: replace inaddr_none with PIMADDR_ANY

We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr
when there is no rp configured for group_all.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #10699 from opensourcerouting/vtysh-live-log-coverity
Mark Stapp [Tue, 1 Mar 2022 17:07:08 +0000 (12:07 -0500)]
Merge pull request #10699 from opensourcerouting/vtysh-live-log-coverity

vtysh: fix coverity issues in live-log code

2 years agoisisd: Add json to show isis neighbor command.
Javier Garcia [Thu, 24 Feb 2022 08:33:53 +0000 (09:33 +0100)]
isisd: Add json to show isis neighbor command.

Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>