]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
19 months agozebra: check for vni before comparison in zl3vni_map_to_vxlan_if_ns
Sharath Ramamurthy [Sat, 7 Aug 2021 17:01:36 +0000 (22:31 +0530)]
zebra: check for vni before comparison in zl3vni_map_to_vxlan_if_ns

Check for vni before doing comparion during vxlan vni search in zl3vni_map_to_vxlan_if_ns

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: add zebra_vxlan_if.h header file to noinst_HEADER
Sharath Ramamurthy [Wed, 4 Aug 2021 09:26:40 +0000 (14:56 +0530)]
zebra: add zebra_vxlan_if.h header file to noinst_HEADER

zebra_vxlan_if.h header file was missed in noinst_HEADERS resulting
in build failure for some platforms.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: add zebra_l2_bridge_if.h header file to noinst_HEADER
Stephen Worley [Wed, 18 May 2022 17:16:55 +0000 (13:16 -0400)]
zebra: add zebra_l2_bridge_if.h header file to noinst_HEADER

zebra_l2_bridge_if.h header file was missed in noinst_HEADERS resulting
in build failure for some platforms.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agozebra: Add ifdump vty json extension for vxlan/vni
Sharath Ramamurthy [Wed, 4 Aug 2021 06:46:25 +0000 (12:16 +0530)]
zebra: Add ifdump vty json extension for vxlan/vni

This patch adds dump for vxlan/vni for vxlan devices in if_dump_vty_json

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: Bug fixes in fdb read for flooded traffic and remote fdb cleanup upon vni...
Sharath Ramamurthy [Tue, 27 Jul 2021 16:29:00 +0000 (21:59 +0530)]
zebra: Bug fixes in fdb read for flooded traffic and remote fdb cleanup upon vni removal

This patch addresses following issues,
- When the VLAN-VNI mapping is configured via a map and not using
  individual VXLAN interfaces, upon removal of a VNI ensure that the
  remote FDB entries are uninstalled correctly.

- When VNI configuration is performed using VLAN-VNI mapping (i.e., without
  individual VXLAN interfaces) and flooded traffic is handled via multicast,
  the multicast group corresponding to the VNI needs to be explicitly read
  from the bridge FDB. This is relevant in the case of netlink interface to
  the kernel and for the scenario where a new VNI is provisioned or comes up.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: Handle vni determination for non-vlan-aware bridges
Sharath Ramamurthy [Tue, 27 Jul 2021 16:20:47 +0000 (21:50 +0530)]
zebra: Handle vni determination for non-vlan-aware bridges

This patch addresses following

- Remove unused VLAN Id parameter when trying to determine the VNI associated
  with a non-VLAN aware bridge. Also, add a check to ensure that in this case,
  we have a per-VNI VXLAN interface. Due to sequence of events, it is possible
  that we may have VLAN-VNI mappings, in which case the code should return
  gracefully.

- With support for a container VXLAN interface that has VLAN-VNI mappings,
  the VXLAN interface itself may be up but a particular VNI might have
  been removed. Ensure that VNI mapping exists before proceeding with
  further processing.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: Bug fixes in vtysh doc string, mcast group handling and vni deletion handling...
Sharath Ramamurthy [Tue, 27 Jul 2021 15:45:09 +0000 (21:15 +0530)]
zebra: Bug fixes in vtysh doc string, mcast group handling and vni deletion handling with single vxlan device

This patch addresses following bug fixes

- Fix vtysh doc string in "show evpn access-vlan..." command
- Multicast group handling was little complex. This change avoids calling
  multiple functions and directly calls the zebra_vxlan_if_update_vni for
  mcast group updates.
- When a vlan-vni map is removed, the removed vni deletion was happening
  in FRR with SVD config. This was resulting in stale vni and not
  resulting propagation of the vni deletion.
  During vni cleanup (zebra_vxlan_if_vni_clean) zebra_vxlan_if_vni_del
  was called for vni delete which is not correct. We should be calling
  zebra_vxlan_if_vni_entry_del for the given vni entry.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and zl3vni_fro...
Sharath Ramamurthy [Tue, 27 Jul 2021 09:24:40 +0000 (14:54 +0530)]
zebra: Refactoring changes for zebra_evpn_map_vlan zebra_evpn_from_svi and zl3vni_from_svi

Today to find the vni for a given (vlan, bridge) we walk over all interfaces
and filter the vxlan device associated with the bridge. With multiple vlan aware
bridge changes, we can derive the vni directly by looking up the hash table i.e.
the vlan_table of the associated (vlan, bridge) which would give the vni.

During vrf_terminate() call zebra_l2_bridge_if_cleanup if the interface
that we are removing is of type bridge. In this case, we walk over all
the vlan<->access_bd association and clean them up.

zebra_evpn_t is modified to record (vlan, bridge) details and the
corresponding vty is modified to print the same.
zevpn_bridge_if_set and zl3vni_bridge_if_set is used to set/unset the
association.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: multiple vlan aware bridge data structure and related changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:58:59 +0000 (14:28 +0530)]
zebra: multiple vlan aware bridge data structure and related changes

Multiple vlan aware bridge data structure changes and its corresponding bridge
handling changes.
A new vlan-table is maintained for each bridge which records the zebra_l2_bridge_vlan
entry. zebra_l2_bridge_vlan maps vlan to access_bd associated to this bridge.

Existing zebra_evpn_access_bd structure is vlan aware which is now modified to be
(vlan, bridge) aware.

Whenever a new access_bd is instantiated, a corresponding entry is also recorded
in the zebra l2 bridge for the vlan.
When the access_bd is dereferenced or whenever a bridge is deleted, the
association is cleaned up.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: single vxlan device vni handling
Sharath Ramamurthy [Tue, 27 Jul 2021 08:48:05 +0000 (14:18 +0530)]
zebra: single vxlan device vni handling

This change brings in following functionality
- netlink_bridge_vxlan_vlan_vni_map_update for single vxlan devices
  This function is responsible for reading the vlan-vni map information
  received from netlink and populating a new hash_table with the vlan-vni
  data. Once all the vlan-vni data is collected, zebra_vxlan_if_vni_table_add_update
  is called to update vni_table in vxlan interface and process each of the
  vlan-vni data.
- refactoring changes for zevpn_build_hash_table
- existing zevpn_build_hash_table was walking over all the vxlan interfaces
  and then processing the vni for each of them. In case of single vxlan device,
  we will have more than one vni entries. This function is abstracted so that
  it iterates over all the vni entries for single vxlan device. For traditional
  vxlan device the zebra_vxlan_if_vni_iterate would only process single vni
  associated with that device.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: vxlan interface handling changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:20:55 +0000 (13:50 +0530)]
zebra: vxlan interface handling changes

This change modifies zebra_vxlan_if_up/down/add/update and del functionality
to be per vni based.

zebra_vxlan_if_add/update/del and zebra_vxlan_if_up/down now handles
the vni operations based on vxlan device type (single or traditional vxlan device).

zebra_vxlan_if_vni_table_add_update
- This function handles the vlan-vni map update received from the netlink
  interface to single vxlan device vni_table hash table.

zebra_vxlan_if_vni_mcast_group_update
- This function handles the new multicast group update received from
  the netlink interface to single vxlan device vni_table hash table.

For traditional vxlan interfaces, the vni and mcast group
handling follows the traditional approach.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: vxlan interface refactoring changes
Sharath Ramamurthy [Tue, 27 Jul 2021 08:10:48 +0000 (13:40 +0530)]
zebra: vxlan interface refactoring changes

This change refactors the zebra_vxlan_if related functionality
to a new zebra_vxlan_if.c file. zebra_vxlan_if_up/down,
zebra_vxlan_if_add/update/del is moved zebra_vxlan_if.c

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: single vxlan device dataplace vni update changes
Sharath Ramamurthy [Tue, 27 Jul 2021 07:52:11 +0000 (13:22 +0530)]
zebra: single vxlan device dataplace vni update changes

dplane_mac_info and dplane_neigh_info is modified to be vni aware.
dplane_rem_mac_add/del dplane_mac_init is modified to be vni aware.

During dplane context update (mac and neigh), we use the vni information
and if set, corresponding netlink attribute NDA_SRC_VNI is set and passed to the
dplane.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: multiple vlan aware bridge datastructure changes and vxlan device iftype deriv...
Sharath Ramamurthy [Tue, 27 Jul 2021 07:47:52 +0000 (13:17 +0530)]
zebra: multiple vlan aware bridge datastructure changes and vxlan device iftype derivation from netlink

This change set introduces data structure changes required for multiple vlan aware bridge
functionality. A new structure zebra_l2_bridge_if encapsulates the vlan to access_bd
association of the bridge. A vlan_table hash_table is used to record each instance
of the vlan to access_bd of the bridge via zebra_l2_bridge_vlan structure.

vxlan iftype derivation: netlink attribute IFLA_VXLAN_COLLECT_METADATA is used
to derive the iftype of the vxlan device. If the attribute is present, then the
vxlan interface is treated as single vxlan device, otherwise it would default to
traditional vxlan device.

zebra_vxlan_check_readd_vtep, zebra_vxlan_dp_network_mac_add/del is modified to
be vni aware.

mac_fdb_read_for_bridge - is modified to be (vlan, bridge) aware

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: data structure changes for single vxlan device
Sharath Ramamurthy [Tue, 27 Jul 2021 07:44:15 +0000 (13:14 +0530)]
zebra: data structure changes for single vxlan device

This changeset introduces the data structure changes needed for
single vxlan device functionality. A new struct zebra_vxlan_vni_info
encodes the iftype and vni information for vxlan device.

The change addresses related access changes of the new data structure
fields from different files

zebra_vty is modified to take care of the vni dump information according
to the new vni data structure for vxlan devices.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agoMerge pull request #12776 from patrasar/Issue_12755
Donald Sharp [Fri, 10 Feb 2023 13:07:32 +0000 (08:07 -0500)]
Merge pull request #12776 from patrasar/Issue_12755

pim6d: Modify "show ipv6 mld join json" o/p

19 months agoMerge pull request #12757 from opensourcerouting/fix/advance_versions_for_packages
Donald Sharp [Fri, 10 Feb 2023 00:36:54 +0000 (19:36 -0500)]
Merge pull request #12757 from opensourcerouting/fix/advance_versions_for_packages

tools: Bump versions for Redhat and Debian packages in changelogs

19 months agoMerge pull request #12762 from sri-mohan1/sri-bable
Donald Sharp [Fri, 10 Feb 2023 00:36:08 +0000 (19:36 -0500)]
Merge pull request #12762 from sri-mohan1/sri-bable

babeld: changes for code maintainability

19 months agoMerge pull request #12782 from opensourcerouting/fix/bgpd_aspath_str_crash
Donald Sharp [Fri, 10 Feb 2023 00:25:19 +0000 (19:25 -0500)]
Merge pull request #12782 from opensourcerouting/fix/bgpd_aspath_str_crash

bgpd: Intern default-originate attributes to avoid use-after-free

19 months agoMerge pull request #12781 from opensourcerouting/fix/memory_leak
Donald Sharp [Fri, 10 Feb 2023 00:25:05 +0000 (19:25 -0500)]
Merge pull request #12781 from opensourcerouting/fix/memory_leak

lib: Release memory of YANG translation module on error

19 months agolib: Free dnode before returning if YANG translator model is already loaded
Donatas Abraitis [Thu, 9 Feb 2023 21:14:46 +0000 (23:14 +0200)]
lib: Free dnode before returning if YANG translator model is already loaded

Seems just a missed one because at `goto error` we release dnode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Check if BGP default-originate withdraw works correctly
Donatas Abraitis [Thu, 9 Feb 2023 20:55:53 +0000 (22:55 +0200)]
tests: Check if BGP default-originate withdraw works correctly

And also do not crash when we do `clear ip bgp ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Intern default-originate attributes to avoid use-after-free
Donatas Abraitis [Thu, 9 Feb 2023 20:29:25 +0000 (22:29 +0200)]
bgpd: Intern default-originate attributes to avoid use-after-free

When we receive a default route from a peer and we originate default route
using `neighbor default-originate`, we do not track of struct attr we use,
and when we do `no neighbor default-originate` we withdraw our generated
default route, but we announce default-route from the peer.

After we do this, we unintern aspath (which was used for default-originate),
BUT it was used also for peer's default route we received.

And here we have a use-after-free crash, because bgp_process_main_one()
reaps old paths that are marked as BGP_PATH_REMOVED with aspath->refcnt > 0,
but here it's 0.

```
0 0x55c24bbcd022 in aspath_key_make bgpd/bgp_aspath.c:2070
1 0x55c24b8f1140 in attrhash_key_make bgpd/bgp_attr.c:777
2 0x7f52322e66c9 in hash_release lib/hash.c:220
3 0x55c24b8f6017 in bgp_attr_unintern bgpd/bgp_attr.c:1271
4 0x55c24ba0acaa in bgp_path_info_free_with_caller bgpd/bgp_route.c:283
5 0x55c24ba0a7de in bgp_path_info_unlock bgpd/bgp_route.c:309
6 0x55c24ba0af6d in bgp_path_info_reap bgpd/bgp_route.c:426
7 0x55c24ba17b9a in bgp_process_main_one bgpd/bgp_route.c:3333
8 0x55c24ba18a1d in bgp_process_wq bgpd/bgp_route.c:3425
9 0x7f52323c2cd5 in work_queue_run lib/workqueue.c:282
10 0x7f52323aab92 in thread_call lib/thread.c:2006
11 0x7f5232300dc7 in frr_run lib/libfrr.c:1198
12 0x55c24b8ea792 in main bgpd/bgp_main.c:520
13 0x7f5231c3a082 in __libc_start_main ../csu/libc-start.c:308
14 0x55c24b8ef0bd in _start (/usr/lib/frr/bgpd+0x2c90bd)
    ```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agolib: Release memory of YANG translation module on error
Donatas Abraitis [Thu, 9 Feb 2023 15:59:11 +0000 (17:59 +0200)]
lib: Release memory of YANG translation module on error

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12730 from louis-6wind/fix-ext-te-metrics
Olivier Dugeon [Thu, 9 Feb 2023 14:12:41 +0000 (15:12 +0100)]
Merge pull request #12730 from louis-6wind/fix-ext-te-metrics

Fix for Extended TE metrics

19 months agoMerge pull request #12773 from donaldsharp/pbr_table_values
mobash-rasool [Thu, 9 Feb 2023 10:47:54 +0000 (16:17 +0530)]
Merge pull request #12773 from donaldsharp/pbr_table_values

pbrd: fix large tableids displayed as negative

19 months agoMerge pull request #12738 from taspelund/adj-rib-specific
Donatas Abraitis [Thu, 9 Feb 2023 09:02:11 +0000 (11:02 +0200)]
Merge pull request #12738 from taspelund/adj-rib-specific

Improvements to advertised/received/bestpath-routes commands

19 months agopim6d: Modify "show ipv6 mld join json" o/p
Sarita Patra [Thu, 9 Feb 2023 07:38:18 +0000 (23:38 -0800)]
pim6d: Modify "show ipv6 mld join json" o/p

Currently "show ipv6 mld join json" o/p is
frr# show ipv6 mld joins json
{
  "default":{
    "ens192":{
      "ff02:2":{
        "::":{
          "state":"JOIN",
          "created":"00:01:50.595",
          "lastSeen":"00:00:38.403",
        }
      }
    }
  }
}

Here, I modified the o/p as below for better understanding.
frr# show ipv6 mld joins json
{
  "default":{
    "vrf":"default",
    "ens192":{
      "ff02::2":{
        "*":{
          "state":"JOIN",
          "created":"00:00:42.766",
          "lastSeen":"00:00:05.266"
        }
      }
    }
  }
}

Issue: #12755

Signed-off-by: Sarita Patra <saritap@vmware.com>
19 months agopbrd: fix large tableids displayed as negative
Wesley Coakley [Tue, 20 Jul 2021 13:25:01 +0000 (09:25 -0400)]
pbrd: fix large tableids displayed as negative

Ticket: 2699411
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
19 months agodoc: optional keyword info for bestpath-routes
Trey Aspelund [Fri, 3 Feb 2023 21:13:38 +0000 (21:13 +0000)]
doc: optional keyword info for bestpath-routes

Adds information about the optional keywords for the bestpath-routes
bgp show command.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
19 months agodoc: prefix match for advertised/received-routes
Trey Aspelund [Fri, 3 Feb 2023 21:11:48 +0000 (21:11 +0000)]
doc: prefix match for advertised/received-routes

Doc changes for new prefix matching.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
19 months agobgpd: prefix match for advertised/received-routes
Trey Aspelund [Fri, 3 Feb 2023 20:59:34 +0000 (20:59 +0000)]
bgpd: prefix match for advertised/received-routes

This introduces the option for a user to lookup one specific prefix in
the advertised-routes or received-routes table of a peer.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
19 months agobgpd: add 'detail' option to bestpath-routes
Trey Aspelund [Fri, 3 Feb 2023 20:44:27 +0000 (20:44 +0000)]
bgpd: add 'detail' option to bestpath-routes

Introduce 'detail' keyword for 'show bgp <afi> <safi> bestpath-routes'.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
19 months agoMerge pull request #12769 from donaldsharp/missing_syslog
Donatas Abraitis [Wed, 8 Feb 2023 20:40:32 +0000 (22:40 +0200)]
Merge pull request #12769 from donaldsharp/missing_syslog

tools: Fix missing pbrd in rsyslog.d 45-frr.conf file

19 months agoMerge pull request #12768 from louis-6wind/fix-grep-vpnv4-noretain
Donatas Abraitis [Wed, 8 Feb 2023 19:53:19 +0000 (21:53 +0200)]
Merge pull request #12768 from louis-6wind/fix-grep-vpnv4-noretain

tests: do not use exclude grep

19 months agotools: Fix missing pbrd in rsyslog.d 45-frr.conf file
Donald Sharp [Wed, 8 Feb 2023 18:04:01 +0000 (13:04 -0500)]
tools: Fix missing pbrd in rsyslog.d 45-frr.conf file

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotests: do not use exclude grep
Louis Scalbert [Wed, 8 Feb 2023 11:05:15 +0000 (12:05 +0100)]
tests: do not use exclude grep

Filter out keys in JSON output with "grep -v" does not work when JSON
does not use the pretty format.

Use native python code to filter out keys.

Fixes: 6c13bd5744 ("topotests: fix bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #12761 from anlancs/fix/bgpd-crash-evpn-vni-both-rts
Donatas Abraitis [Wed, 8 Feb 2023 08:07:07 +0000 (10:07 +0200)]
Merge pull request #12761 from anlancs/fix/bgpd-crash-evpn-vni-both-rts

bgpd: fix use-after-free crash for evpn

19 months agoMerge pull request #12654 from Pdoijode/evpn-evi-detail-json-changes
Donatas Abraitis [Tue, 7 Feb 2023 21:31:53 +0000 (23:31 +0200)]
Merge pull request #12654 from Pdoijode/evpn-evi-detail-json-changes

zebra: fix JSON fields for show evpn vni detail

19 months agoMerge pull request #12707 from donaldsharp/missed_enums
Donatas Abraitis [Tue, 7 Feb 2023 20:22:27 +0000 (22:22 +0200)]
Merge pull request #12707 from donaldsharp/missed_enums

Missed enums

19 months agotools: Bump versions for Redhat and Debian packages in changelogs
Donatas Abraitis [Tue, 7 Feb 2023 19:37:18 +0000 (21:37 +0200)]
tools: Bump versions for Redhat and Debian packages in changelogs

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12759 from opensourcerouting/fix/revalidate_commit_on_pr_update
Donald Sharp [Tue, 7 Feb 2023 20:13:50 +0000 (15:13 -0500)]
Merge pull request #12759 from opensourcerouting/fix/revalidate_commit_on_pr_update

tools: Revalidate commits when PR is updated

19 months agotools: Fetch more commits for commitlint to validate the commit
Donatas Abraitis [Tue, 7 Feb 2023 20:03:42 +0000 (22:03 +0200)]
tools: Fetch more commits for commitlint to validate the commit

Note: It's necessary that you specify the fetch-depth argument to
actions/checkout@v2 step. By default they fetch only latest commit of the
branch, but we need more commits since we validate a range of commit messages.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotools: Revalidate commits when PR is updated
Donatas Abraitis [Tue, 7 Feb 2023 19:55:31 +0000 (21:55 +0200)]
tools: Revalidate commits when PR is updated

Trigger GH action also if labeled, unlabeled.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12756 from opensourcerouting/fix/add_build_to_commits
Donald Sharp [Tue, 7 Feb 2023 19:50:00 +0000 (14:50 -0500)]
Merge pull request #12756 from opensourcerouting/fix/add_build_to_commits

tools: Add `build` as a valid prefix for commit messages

19 months agotools: Add `build` as a valid prefix for commit messages
Donatas Abraitis [Tue, 7 Feb 2023 19:31:00 +0000 (21:31 +0200)]
tools: Add `build` as a valid prefix for commit messages

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobuild: FRR 9.0 development version
Donatas Abraitis [Tue, 7 Feb 2023 19:25:42 +0000 (21:25 +0200)]
build: FRR 9.0 development version

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12722 from opensourcerouting/vim-xref
Jafar Al-Gharaibeh [Tue, 7 Feb 2023 16:43:27 +0000 (10:43 -0600)]
Merge pull request #12722 from opensourcerouting/vim-xref

tools: add `GotoXref` vim script

19 months agoMerge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_...
Jafar Al-Gharaibeh [Tue, 7 Feb 2023 16:42:53 +0000 (10:42 -0600)]
Merge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_commits

Commits hygiene

19 months agoMerge pull request #12748 from opensourcerouting/fix/route_map_vpn_import
Russ White [Tue, 7 Feb 2023 16:40:03 +0000 (11:40 -0500)]
Merge pull request #12748 from opensourcerouting/fix/route_map_vpn_import

tests: Check if route-map vpn import basic funtionality works fine

19 months agoMerge pull request #12720 from opensourcerouting/fix/ecommunity_ipv6_missing_token
Russ White [Tue, 7 Feb 2023 14:21:07 +0000 (09:21 -0500)]
Merge pull request #12720 from opensourcerouting/fix/ecommunity_ipv6_missing_token

bgpd: ecommunity_token_rt6 is not handled

19 months agoMerge pull request #12741 from thesamesam/missing-time
Donatas Abraitis [Tue, 7 Feb 2023 09:05:46 +0000 (11:05 +0200)]
Merge pull request #12741 from thesamesam/missing-time

pceplib: add <time.h> include for time_t

19 months agobabeld: changes for code maintainability
sri-mohan1 [Tue, 7 Feb 2023 08:05:04 +0000 (13:35 +0530)]
babeld: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
19 months agopceplib: add <time.h> include for time_t
Sam James [Sat, 4 Feb 2023 23:29:59 +0000 (23:29 +0000)]
pceplib: add <time.h> include for time_t

Fixes build on musl. Used for time_t in the header.

Bug: https://bugs.gentoo.org/862558
Signed-off-by: Sam James <sam@gentoo.org>
19 months agobgpd: Add more context in logs about from where to where routes are leaked
Donatas Abraitis [Mon, 6 Feb 2023 16:41:19 +0000 (18:41 +0200)]
bgpd: Add more context in logs about from where to where routes are leaked

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Drop struct bgp from vpn_leak_to_vrf_withdraw()
Donatas Abraitis [Mon, 6 Feb 2023 16:40:44 +0000 (18:40 +0200)]
bgpd: Drop struct bgp from vpn_leak_to_vrf_withdraw()

Not used at all, just drop it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agotests: Check if `route-map vpn import` basic funtionality works fine
Donatas Abraitis [Mon, 6 Feb 2023 16:38:52 +0000 (18:38 +0200)]
tests: Check if `route-map vpn import` basic funtionality works fine

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: fix use-after-free crash for evpn
anlan_cs [Mon, 6 Feb 2023 01:27:05 +0000 (09:27 +0800)]
bgpd: fix use-after-free crash for evpn

```
anlan(config-router-af)# vni 33
anlan(config-router-af-vni)# route-target both 44:55
anlan(config-router-af-vni)# no route-target both 44:55
vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!
```

When `bgp_evpn_vni_rt_cmd` deals with "both" type, it wrongly created
only one node ( should be two nodes ) for lists of both `vpn->import_rtl` and
`vpn->export_rtl`.  At this time, the two lists are already wrong.

In `no route-target both RT`, it will free the single node from lists of both
`vpn->import_rtl` and `vpn->export_rtl`.  After freed from `vpn->import_rtl`,
it is "use-after-free" at the time of freeing it from `vpn->export_rtl`.
It causes crash sometimes, or other unexpected behaviours.

This issue is introduced by commit `3b7e8d`, which have adjusted both
`bgp_evpn_vni_rt_cmd` and `bgp_evpn_vrf_rt_cmd`.

Since `bgp_evpn_vrf_rt_cmd/no_bgp_evpn_vrf_rt_cmd` works well again
unintentionally with commit `7022da`, only `bgp_evpn_vni_rt_cmd` needs to
modify - add two nodes for "both" type and some explicit comments for this
special case of "both" type.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
19 months agoMerge pull request #12740 from vfreex/babel-fix-filtering
Donatas Abraitis [Mon, 6 Feb 2023 13:24:56 +0000 (15:24 +0200)]
Merge pull request #12740 from vfreex/babel-fix-filtering

babeld: Fix filtering against all interfaces

19 months agobabeld: Fix filtering against all interfaces
Yuxiang Zhu [Sat, 4 Feb 2023 17:20:43 +0000 (17:20 +0000)]
babeld: Fix filtering against all interfaces

The first argument of `access_list_lookup` and `prefix_list_lookup`
should be `AFI_` constants instead of `AF_` constants.

Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
19 months agoMerge pull request #12668 from anlancs/fix/zebra-evpn-missing-advertise
Donatas Abraitis [Sat, 4 Feb 2023 10:52:22 +0000 (12:52 +0200)]
Merge pull request #12668 from anlancs/fix/zebra-evpn-missing-advertise

zebra: fix wrong conversion for evpn advertising

19 months agoMerge pull request #12732 from donaldsharp/fix_bgp_open_issues
Mark Stapp [Fri, 3 Feb 2023 12:17:00 +0000 (07:17 -0500)]
Merge pull request #12732 from donaldsharp/fix_bgp_open_issues

bgpd: Don't try to recursively hold peer io mutex

19 months agobgpd: Don't try to recursively hold peer io mutex
Donald Sharp [Thu, 2 Feb 2023 19:13:12 +0000 (14:13 -0500)]
bgpd: Don't try to recursively hold peer io mutex

BGP was modified in a0b937de428e14e869b8541f0b7810113d619c2e
to grab the peer->io_mtx before validating the header to ensure
that the input Queue was not being modified by anyone else at that
moment in time.  Unfortunately validate_header can detect a problem
and attempt to relock the mutex, which deadlocks.  This deadlock in
the bgp_io pthread is the lone deadlock at first, eventually though
bgp attempts to write another packet to the peer( say when the
it's time to send the next packet ) and the main pthread of bgpd
becomes deadlocked and then the whole bgpd process is stuck at that
point in time leaving us dead in the water.

The point of locking the mutex earlier was to ensure that the input
Queue wasn't being modified by anyone else, (Say reading off it )
as that we wanted to ensure that we don't hold more packets then necessary.

Let's grab the mutex long enough to look at the input Q size, this
ensure that we have room and then we can validate_header and do the right
thing from there.  We'll need to lock the mutex when we actually move it
into the input Q as well.

Fixes: #12725
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #12731 from donaldsharp/remove_pretty_print
Russ White [Thu, 2 Feb 2023 20:44:45 +0000 (15:44 -0500)]
Merge pull request #12731 from donaldsharp/remove_pretty_print

lib, bgpd: Add ability to specify that some json output should not be…

19 months agobgpd: Convert evpn output to not pretty print json
Donald Sharp [Thu, 2 Feb 2023 15:40:07 +0000 (10:40 -0500)]
bgpd: Convert evpn output to not pretty print json

Commit: 3cdb03fba7b40240fb38469a12b7b05a11043e09
changed the vty_json output to not be pretty printing.
The previous commit in the tree added vty_json_no_pretty
let's use that instead

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, bgpd: Add ability to specify that some json output should not be pretty
Donald Sharp [Thu, 2 Feb 2023 15:28:19 +0000 (10:28 -0500)]
lib, bgpd: Add ability to specify that some json output should not be pretty

Initial commit: 23b2a7ef524c9fe083b217c7f6ebaec0effc8f52
changed the json output of `show bgp <afi> <safi> json` to
not have pretty print because when under a situation where
there are a bunch of routes with a large scale ecmp show
output was taking forever and this commit cut 2 minutes out
of vtysh run time.

Subusequent commit: f4ec52f7cc99f709756d9030623a20c98a086125
changed this back.

When upgrading to latest version the long run time was noticed
due to testing.  Let's add back this functionality such that
FRR can have reduced run times with vtysh when it's really
needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoisisd: use the te anormal macro
Louis Scalbert [Thu, 2 Feb 2023 15:06:59 +0000 (16:06 +0100)]
isisd: use the te anormal macro

Use the te anormal macro

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoisisd: fix te link delay display
Louis Scalbert [Thu, 2 Feb 2023 15:13:39 +0000 (16:13 +0100)]
isisd: fix te link delay display

Apply the TE_EXT_MASK mask to display a 24 bits instead of a wrong 32
bits value that includes unrelated bits.

Fixes: 1b3f47d04c ("isisd: Update TLVs processing for TE, RI & SR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agolib: fix traffic engineering extended mask
Louis Scalbert [Thu, 2 Feb 2023 14:44:31 +0000 (15:44 +0100)]
lib: fix traffic engineering extended mask

RFC7471 and RFC8570 have defined the Extended Traffic Engineering
metrics that are carried within TLV of 32 bits data length. Extended
metrics, excepting bandwidth ones, use the following format:

>     0                   1                   2                   3
>     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |   Type        |     Length    |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>    |A|  RESERVED   |                   Value                       |
>    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Data contains a flag/reserved of 8 bits and a 24 bits value.

The TE_EXT_MASK mask macro extracts a 28 bits value from a 32 bits
variable instead of 24 bits. It works in most of the case because
RESERVED bits are generally set to 0.

Fix the TE_EXT_MASK mask.

Fixes: 16f1b9ee29 ("Update Traffic Engineering Support for OSPFD")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #12729 from opensourcerouting/fix/treat-as-withdraw_nlri_update
Donald Sharp [Thu, 2 Feb 2023 13:29:59 +0000 (08:29 -0500)]
Merge pull request #12729 from opensourcerouting/fix/treat-as-withdraw_nlri_update

bgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw

19 months agobgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw
Donatas Abraitis [Tue, 24 Jan 2023 08:32:13 +0000 (10:32 +0200)]
bgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw

Before this patch, we always passed `struct attr` for NLRI_UPDATE, but if we
have a situation with treat-as-withdraw (for example: malformed attribute, or
using a command like `neighbor path-attribute treat-as-withdraw`) the route
MUST be withdrawn form the BGP table.

Hence, we MUST pass attr as NULL, in this case we already have this check
under NLRI_ATTR_ARG() macro, just reuse it properly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #12672 from donaldsharp/remove_insecure
Donatas Abraitis [Wed, 1 Feb 2023 20:45:20 +0000 (22:45 +0200)]
Merge pull request #12672 from donaldsharp/remove_insecure

vtysh: Remove shell access code

19 months agoMerge pull request #12713 from opensourcerouting/fix/json_naming_deprecation
Donald Sharp [Wed, 1 Feb 2023 20:39:18 +0000 (15:39 -0500)]
Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecation

*: Drop deprecated incorrect JSON fields with wrong naming

19 months agoMerge pull request #12721 from opensourcerouting/format-warnings-redux
Christian Hopps [Wed, 1 Feb 2023 16:13:46 +0000 (11:13 -0500)]
Merge pull request #12721 from opensourcerouting/format-warnings-redux

*: more format string fixing

19 months agovtysh: Schedule shell access for deprecation
Donald Sharp [Wed, 1 Feb 2023 15:26:41 +0000 (10:26 -0500)]
vtysh: Schedule shell access for deprecation

Schedule shell access for deprecation and removal in
a years time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotests: add missing printf attribute
David Lamparter [Tue, 31 Jan 2023 21:17:10 +0000 (22:17 +0100)]
tests: add missing printf attribute

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agotests: yank asprintfrr duplicate
David Lamparter [Tue, 31 Jan 2023 21:12:41 +0000 (22:12 +0100)]
tests: yank asprintfrr duplicate

I think this one predates the existence of asprintfrr.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agolib: fix one more b0rked format string
David Lamparter [Tue, 31 Jan 2023 21:05:17 +0000 (22:05 +0100)]
lib: fix one more b0rked format string

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agobgpd/rfapi: add missing printf attribute
David Lamparter [Tue, 31 Jan 2023 21:04:39 +0000 (22:04 +0100)]
bgpd/rfapi: add missing printf attribute

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agolib: apply more `printf` attributes
David Lamparter [Tue, 31 Jan 2023 20:58:41 +0000 (21:58 +0100)]
lib: apply more `printf` attributes

... missed some functions in the earlier commits :(

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agotools: add GotoXref vim script
David Lamparter [Tue, 31 Jan 2023 22:18:52 +0000 (23:18 +0100)]
tools: add GotoXref vim script

Let's make these unique IDs actually a bit useful.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago*: Add -Wswitch-enum to build
Donald Sharp [Mon, 30 Jan 2023 15:12:06 +0000 (10:12 -0500)]
*: Add -Wswitch-enum to build

The -Wswitch-enum will allow the compiler to warn us
when a developer creates a switch over a enum and is
using `default:` when they should be iterating over
every enum

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotools: Add missing enums to switch statement
Donald Sharp [Mon, 30 Jan 2023 16:05:23 +0000 (11:05 -0500)]
tools: Add missing enums to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoqpb: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:11:50 +0000 (10:11 -0500)]
qpb: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopceplib: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:11:32 +0000 (10:11 -0500)]
pceplib: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoripngd: Add missing enums to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:11:15 +0000 (10:11 -0500)]
ripngd: Add missing enums to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoripd: Add missin enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:10:59 +0000 (10:10 -0500)]
ripd: Add missin enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopbrd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:10:45 +0000 (10:10 -0500)]
pbrd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoospfd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:09:53 +0000 (10:09 -0500)]
ospfd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoldpd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:09:37 +0000 (10:09 -0500)]
ldpd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agostaticd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:09:22 +0000 (10:09 -0500)]
staticd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agonhrpd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:09:04 +0000 (10:09 -0500)]
nhrpd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoisisd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:08:47 +0000 (10:08 -0500)]
isisd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopathd: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:08:25 +0000 (10:08 -0500)]
pathd: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopimd: Add missing enums to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:08:06 +0000 (10:08 -0500)]
pimd: Add missing enums to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: Add missing enum's to switch statement
Donald Sharp [Mon, 30 Jan 2023 15:06:29 +0000 (10:06 -0500)]
lib: Add missing enum's to switch statement

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agozebra: Add missing enums to switch statements
Donald Sharp [Mon, 30 Jan 2023 15:05:58 +0000 (10:05 -0500)]
zebra: Add missing enums to switch statements

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #12667 from donaldsharp/zebra_rib_fixup
Donatas Abraitis [Tue, 31 Jan 2023 19:41:30 +0000 (21:41 +0200)]
Merge pull request #12667 from donaldsharp/zebra_rib_fixup

tests: zebra_rib remove a sleep

19 months agobgpd: ecommunity_token_rt6 is not handled
Donald Sharp [Fri, 27 Jan 2023 13:10:08 +0000 (08:10 -0500)]
bgpd: ecommunity_token_rt6 is not handled

The function ecommunity_str2com_internal appears to want to handle
the ecommunity_token_rt6 enum but skips over it.  Commit
9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081 tried to add this but I really
don't see how this is going to behave correctly.  Add the
ecommunity_token_rt6 case to the switch statement so it is handled
appropriately?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #12704 from donaldsharp/pim6_route_map
Donatas Abraitis [Tue, 31 Jan 2023 18:51:45 +0000 (20:51 +0200)]
Merge pull request #12704 from donaldsharp/pim6_route_map

pimd: v6 intentionally turned off route-maps.  Turn it on.