]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
19 months agozebra: add show commands for SVD global neigh table
Stephen Worley [Thu, 8 Apr 2021 18:27:57 +0000 (14:27 -0400)]
zebra: add show commands for SVD global neigh table

Add some show commands and expand some already existing
commands so we can get debug info from the SVD global
neigh table inside zebra.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agozebra: nhg resolution handler for d-vni
Stephen Worley [Mon, 5 Apr 2021 21:16:38 +0000 (17:16 -0400)]
zebra: nhg resolution handler for d-vni

Add code in the nhg resolution path for determining if Downstream
VNI is in play. This is the only place in all of zebra where
we should be arbitrarily setting the ifindex/labels since
this is where new nhgs are created/destroyed. If something
changes, it must happen here.

We determine if D-VNI is being used by matching the carried
label (VNI) on the nexthop with the vrf VNI from the route.
If they do not match, we can assume this is a D-VNI labeled
nexthop.

We loop through all of the group to see if any are D-VNI. If even
one is, we must treat them all as such. Otherwise, fallback to
traditional EVPN route handling and remove all the labels.

If they are going to be treated as D-VNI we retain the labels and
verify the underlying VRF vxlan interface is a Single VXlan Device.
If it is not, we cannot use D-VNI. If it is, continue on. The VNI label
will encapped via LWTUNNEL and sent to the kernel.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agozebra: install neigh entries on SVD
Stephen Worley [Thu, 1 Apr 2021 16:00:04 +0000 (12:00 -0400)]
zebra: install neigh entries on SVD

Install neigh entries always on SVD if it exists in
zebra. If zebra is using a Single Vxlan Device, we must
duplicate the install of our neigh entries to it so that
vxlan communication can also work across it in the downstream VNI
case.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agolib,sharpd: add ability for sharpd to install vni labels
Stephen Worley [Thu, 1 Apr 2021 15:55:05 +0000 (11:55 -0400)]
lib,sharpd: add ability for sharpd to install vni labels

Add the ability for sharpd to install vni labels for testing.

This patch is just for testing/dev work purposes with evpn.
It adds some code to vty for nexthop-groups so we can explicitly
add a label to nexthops and then let sharpd encode them to zebra.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agozebra: encode vni label via lwt encap
Stephen Worley [Thu, 1 Apr 2021 15:50:31 +0000 (11:50 -0400)]
zebra: encode vni label via lwt encap

Encode the vni label during route install on linux
systems via lwt encap 64bit LWTUNNEL_IP_ID. The kernel expects
this in network byte order, so we convert it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agobgpd: send L3VNI as route labels to zebra
Stephen Worley [Thu, 1 Apr 2021 15:43:23 +0000 (11:43 -0400)]
bgpd: send L3VNI as route labels to zebra

Add functionality to always send the L3VNI to zebra as a label
on the route. It will be zebra's job to determine how to use it (i.e.
via Single Vxlan Device or not).

The l3VNI according to rfc should always be the second for a type2 route
and be the only one available for a type5. Hence, we can just grab the
last label in the stack here and add it onto the route.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agolib: add label_type as field in zapi_nexthop
Stephen Worley [Mon, 5 Apr 2021 21:12:01 +0000 (17:12 -0400)]
lib: add label_type as field in zapi_nexthop

Add the ability to specify the label type along with the labels
you are passing to zebra in zapi_nexthop. This is needed as we
abstract the label code to be re-used by evpn as well as mpls.

Protocols need to be able to set the type of label they have attached.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agolib,zebra,bgpd,staticd: use label code to store VNI info
Stephen Worley [Thu, 1 Apr 2021 15:31:44 +0000 (11:31 -0400)]
lib,zebra,bgpd,staticd: use label code to store VNI info

Use the already existing mpls label code to store VNI
info for vxlan. VNI's are defined as labels just like mpls,
we should be using the same code for both.

This patch is the first part of that. Next we will need to
abstract the label code to not be so mpls specific. Currently
in this, we are just treating VXLAN as a label type and storing
it that way.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agolib: add has_label function for nexthop groups
Stephen Worley [Mon, 5 Apr 2021 21:13:01 +0000 (17:13 -0400)]
lib: add has_label function for nexthop groups

Add a function nexthop_group_has_label() for determining
if even a single nexthop in the group has a label on it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agolib: add 64bit versions of htonl/ntohl
Stephen Worley [Thu, 1 Apr 2021 15:22:40 +0000 (11:22 -0400)]
lib: add 64bit versions of htonl/ntohl

Add 64bit version of htonl/ntohl.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
19 months agotests: add new topotest for single vxlan device config
Sharath Ramamurthy [Mon, 27 Sep 2021 13:27:02 +0000 (13:27 +0000)]
tests: add new topotest for single vxlan device config

Add new topo tests for validating mac learning, bridging and routing
with single vxlan device configuration

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: Add documentation for Single Vxlan Device support
Sharath Ramamurthy [Wed, 18 Aug 2021 06:08:19 +0000 (11:38 +0530)]
zebra: Add documentation for Single Vxlan Device support

Add documentation for single vxlan device suppport and configuration
commands

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
19 months agozebra: fix for issues found during static analysis
Sharath Ramamurthy [Sun, 8 Aug 2021 05:58:07 +0000 (11:28 +0530)]
zebra: fix for issues found during static analysis

This patch addresses fix for issues found during static analysis.
rt_netlink - initialise vtep if there is NDA_DST attribute
if_netlink - initialise vni_start and vni_end

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
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 agodoc: Add documentation for `debug routemap [detail]`
Donald Sharp [Mon, 13 Feb 2023 14:39:57 +0000 (09:39 -0500)]
doc: Add documentation for `debug routemap [detail]`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agozebra: Add access-list lookup failures to debug routemap detail
Donald Sharp [Mon, 13 Feb 2023 14:35:55 +0000 (09:35 -0500)]
zebra: Add access-list lookup failures to debug routemap detail

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agozebra: Add prefix-list lookup failures to routemap debug detail
Donald Sharp [Mon, 13 Feb 2023 14:34:38 +0000 (09:34 -0500)]
zebra: Add prefix-list lookup failures to routemap debug detail

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoospfd: Warn operator about prefix lists not existing in routemaps
Donald Sharp [Mon, 13 Feb 2023 14:32:25 +0000 (09:32 -0500)]
ospfd: Warn operator about prefix lists not existing in routemaps

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoospfd: Add access-list lookup failures to routemap code
Donald Sharp [Mon, 13 Feb 2023 14:30:44 +0000 (09:30 -0500)]
ospfd: Add access-list lookup failures to routemap code

When using access-list and the access-list is not specified
let's give the operator some clue about what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Add useful information to prefix list lookup failures in routemaps
Donald Sharp [Mon, 13 Feb 2023 14:26:30 +0000 (09:26 -0500)]
bgpd: Add useful information to prefix list lookup failures in routemaps

When a routemap lookup of the prefix fails, add some useful data to
the end operator about what has just gone wrong when they are
using `debug routemap detail`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Add access list lookup failure to `debug routemap detail`
Donald Sharp [Mon, 13 Feb 2023 14:22:36 +0000 (09:22 -0500)]
bgpd: Add access list lookup failure to `debug routemap detail`

Let's give the operator some inkling as to why a routemap is
not working the way they thing it should be when something
goes wrong using it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: Add `debug routemap [detail]`
Donald Sharp [Mon, 13 Feb 2023 14:14:56 +0000 (09:14 -0500)]
lib: Add `debug routemap [detail]`

Add the ability to turn on `debug routemap detail` for FRR.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: Start partitioning of rmap_debug to allow detail level
Donald Sharp [Mon, 13 Feb 2023 14:06:56 +0000 (09:06 -0500)]
lib: Start partitioning of rmap_debug to allow detail level

Change the bool to a uint32_t and setup a flag to test
for and set against.  Future commits will allow
a debug detail which should be used by match/set statements
to give further context of what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Add warning when access list does not exist in route-map
Donald Sharp [Sun, 12 Feb 2023 17:33:49 +0000 (12:33 -0500)]
bgpd: Add warning when access list does not exist in route-map

When using `match ip[v6] next-hop <Access-list>` warn
when creating the access-list that the access list does
not yet exist and nothing can be done with it yet.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agozebra: Use string for type instead of number
Donald Sharp [Sun, 12 Feb 2023 17:28:10 +0000 (12:28 -0500)]
zebra: Use string for type instead of number

Let's make it easier to debug instead of guessing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotests: Added ospfv2 flood reduction topotest changes.
Manoj Naragund [Wed, 30 Nov 2022 05:11:21 +0000 (21:11 -0800)]
tests: Added ospfv2 flood reduction topotest changes.

Have added topotest to verify below scenarios.

1. Verify OSPF Flood reduction functionality with ospf enabled on process level.
2. Verify OSPF Flood reduction functionality with ospf enabled on area level.
3. Verify OSPF Flood reduction functionality between different area's

Have sussessfully tested these in my local setup

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
19 months agobgpd: handle case where passed RD is null
Philippe Guibert [Fri, 10 Feb 2023 17:12:48 +0000 (18:12 +0100)]
bgpd: handle case where passed RD is null

The function vpn_leak_to_vrf_update_onevrf() has the RD parameter
set to NULL. Test the RD value before displaying it in the called
function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agovrrpd: give null when using null ifp to lookup vr
Quentin Young [Mon, 28 Oct 2019 15:41:38 +0000 (15:41 +0000)]
vrrpd: give null when using null ifp to lookup vr

This is still causing crashes somehow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
19 months agolib, zebra: Consolidate ZEBRA_TABLE_MAX_DISTANCE values
Donald Sharp [Fri, 10 Feb 2023 14:04:44 +0000 (09:04 -0500)]
lib, zebra: Consolidate ZEBRA_TABLE_MAX_DISTANCE values

Currently `ip import-table 33` imports routes with
a distance of 15, as defined by zebra.h.  zebra_rib.c
on the other hand believes the default value for the table
is 150.  Let's make them agree with each other.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, zebra: Use defines for distance
Donald Sharp [Fri, 10 Feb 2023 13:54:56 +0000 (08:54 -0500)]
lib, zebra: Use defines for distance

Use the defines for distance that are in zebra.h.  We could
easily have a cluster where we don't agree with ourselves.  So
let's convert zebra to use the defines in zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALL
Donald Sharp [Fri, 10 Feb 2023 13:39:33 +0000 (08:39 -0500)]
lib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALL

The define of ZEBRA_ON_RIB_PROCESS_HOOK_CALL was in zebra.h
which exposes it to everyone, except zebra is the only daemon
to use this define.  This does not beling in zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: Remove include of asm/types.h
Donald Sharp [Fri, 10 Feb 2023 13:35:44 +0000 (08:35 -0500)]
lib: Remove include of asm/types.h

We do not use this, nor should we.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agolib: Remove include of linux specific version.h
Donald Sharp [Fri, 10 Feb 2023 13:31:56 +0000 (08:31 -0500)]
lib: Remove include of linux specific version.h

We apparently do not use it and looking at what this
file actually includes, we should not be including this
at all.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:59 +0000 (08:28 -0500)]
bgpd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopimd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:46 +0000 (08:28 -0500)]
pimd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agopathd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:28:28 +0000 (08:28 -0500)]
pathd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agobgpd: Remove extraneous include of version.h
Donald Sharp [Fri, 10 Feb 2023 13:27:42 +0000 (08:27 -0500)]
bgpd: Remove extraneous include of version.h

It's not needed in these compiles.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agodoc: add extended admin-group user documentation
Louis Scalbert [Tue, 13 Dec 2022 13:03:34 +0000 (14:03 +0100)]
doc: add extended admin-group user documentation

Add the extended admin-group user documentation using affinity-maps.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agotests: add extended admin-group test in isis_te_topo1
Louis Scalbert [Fri, 9 Dec 2022 13:11:50 +0000 (14:11 +0100)]
tests: add extended admin-group test in isis_te_topo1

Add extended admin-group test in isis_te_topo1

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.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 agolib,isisd: add extended admin-group info into the ted
Louis Scalbert [Fri, 9 Dec 2022 11:34:50 +0000 (12:34 +0100)]
lib,isisd: add extended admin-group info into the ted

Add extended admin-group info into the ted.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agolib,zebra: add affinity-map configuration hooks
Louis Scalbert [Wed, 9 Nov 2022 14:17:19 +0000 (15:17 +0100)]
lib,zebra: add affinity-map configuration hooks

Add affinity-map hooks to check the utilization of affinity-map in
link-params before its deletion and to update link-params when the
affinity-map bit-position is updated.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoisisd: add extended admin-group
Louis Scalbert [Tue, 8 Nov 2022 17:05:02 +0000 (18:05 +0100)]
isisd: add extended admin-group

Add to the Extended IS Reachability TLV the support of Extended
Administrative-Groups (RFC7308)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agolib: extend sbuf size
Louis Scalbert [Tue, 27 Sep 2022 10:22:24 +0000 (12:22 +0200)]
lib: extend sbuf size

sbuf variable is used among other things to store IS-IS database output.
Future commits will introduce the output of extended access groups in
the "show isis database detail" output.

Extend the sbuf size to have chance to store all information.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agolib,yang,zebra: add extended admin-group support
Louis Scalbert [Tue, 8 Nov 2022 16:59:33 +0000 (17:59 +0100)]
lib,yang,zebra: add extended admin-group support

Add the support of Extended Admin-Group (RFC7308) to the zebra interface
link-params Traffic-Engineering context.

Extended admin-groups can be configured with the affinity-map:

> affinity-map blue bit-position 221
> int eth-rt1
>  link-params
>   affinity blue
>  exit-link-params

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agotools: allow // SPDX... in checkpatch.pl
David Lamparter [Fri, 10 Feb 2023 09:47:36 +0000 (10:47 +0100)]
tools: allow // SPDX... in checkpatch.pl

Using // style comments for the SPDX license identifier was kind of an
intentional choice to make it stand out as "directive-like" comment (and
also to constrain it to the one line.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agobgpd: fix dereference of null pointer in bgp_attr_aspath
Philippe Guibert [Fri, 3 Feb 2023 08:41:41 +0000 (09:41 +0100)]
bgpd: fix dereference of null pointer in bgp_attr_aspath

The peer pointer theorically have a NULL bgp pointer. This triggers
a SA issue. So let us fix it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: fix dereference of null pointer in 'bgp_evpn_es_evi_show_entry'
Philippe Guibert [Mon, 28 Nov 2022 09:31:58 +0000 (10:31 +0100)]
bgpd: fix dereference of null pointer in 'bgp_evpn_es_evi_show_entry'

The bgp_evpn_es_evi_show_entry() function tries to access the vni
attribute, while the vpn structure may be null.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agotopotests: add bgp_asdot_regex test
Philippe Guibert [Mon, 28 Nov 2022 09:13:07 +0000 (10:13 +0100)]
topotests: add bgp_asdot_regex test

This test ensures that the regex used to filter as paths has to
be expressed in the asnotation of the BGP instance where prefixes
are received. 2 aspaths have been forged, both for AS 65540, but
only the former is expressed in asdot. If the local BGP instance
is expressed in asdot format, then only the former ASPATH will
match properly the incoming update. Reversely, when the local BGP
instance is expressed in plain format, then only the latter ASPATH
will match properly the incoming update.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: add as notation support for bgp rpki service
Philippe Guibert [Fri, 25 Nov 2022 16:51:33 +0000 (17:51 +0100)]
bgpd: add as notation support for bgp rpki service

Rpki service uses AS number:
- some show commands use the as number as paramter.
use asnotation support.
- the as number of entries is displayed based on the
asnotation mode of the chose bgp instance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: handle network rd parameter in network configuration
Philippe Guibert [Fri, 25 Nov 2022 11:24:15 +0000 (12:24 +0100)]
bgpd: handle network rd parameter in network configuration

The bgp network command creates static routes with an optional
route-distinguisher parameter for VPN and EVPN address families.
Store the rd parameter in those static routes. This will be used
by the 'show running-config' later.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agotests: add unit tests to bgp aspath to check as dot format
Philippe Guibert [Fri, 25 Nov 2022 09:07:28 +0000 (10:07 +0100)]
tests: add unit tests to bgp aspath to check as dot format

4 aspath tests are added, and expect the output string format
tobe in dot+ format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agotopotests: add bgp_local_asn_dot test
Philippe Guibert [Thu, 24 Nov 2022 16:32:10 +0000 (17:32 +0100)]
topotests: add bgp_local_asn_dot test

This test performs AS handling operations on BGP instances,
and does some checks by using the asdot notation. AS4B values
are used for configuration.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: support for route-distinguisher format with 3 fields
Philippe Guibert [Thu, 24 Nov 2022 15:13:08 +0000 (16:13 +0100)]
bgpd: support for route-distinguisher format with 3 fields

The ietf proposes to define a RD with a 3 field separated by
the ':' character. The last 2 fields stands for the usual
fields, namely AS4B:NN, AS2B,NNNN, IP:NN. The first field
stands for the kind of route distinguisher used.

Today, except with the route-map, no other RD configuration
supports this mode. Handle the support for this in FRR.

Link: https://github.com/FRRouting/frr/blob/master/yang/ietf/ietf-routing-types.yang#L258
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agoyang: route-distinguisher typedef support asdot notation
Philippe Guibert [Thu, 24 Nov 2022 14:44:53 +0000 (15:44 +0100)]
yang: route-distinguisher typedef support asdot notation

Some route-distinguisher notation is not supported today.
route-map rmap permit 1
 match evpn rd 1.1:1
 match evpn rd 0.65000:1
!

Add support for this.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agoyang: route-distinguisher typedef for route-maps reworked
Philippe Guibert [Thu, 24 Nov 2022 13:02:31 +0000 (14:02 +0100)]
yang: route-distinguisher typedef for route-maps reworked

Some route-distinguisher combinations were not possible under
route-maps:
route-map rmap permit 1
 match evpn rd 65540:44
 match evpn rd 1.2.3.4:44
 match evpn rd 2000000:44

Do not use the ietf definition for route-distinguisher by overriding
a new definition in bgp-route-map.yang itself. When the BGP northbound
API will be done, this route-distinguisher definition will have to
be used too.

Fixes: ("48cb7ea99d10") bgpd: North-bound implementation for bgp rmaps
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agotopotests: add test with aspath list encoded as asdot+ format
Philippe Guibert [Wed, 23 Nov 2022 14:46:34 +0000 (15:46 +0100)]
topotests: add test with aspath list encoded as asdot+ format

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: store the route-distinguisher from config as a string
Philippe Guibert [Tue, 22 Nov 2022 10:20:51 +0000 (11:20 +0100)]
bgpd: store the route-distinguisher from config as a string

The route-distinguisher string can be expressed in different
ways when the AS number is part of the RD. And the configured
string value has to be kept intact.
The following vty commands store the string value internally:
- router bgp / address-family ipv4 unicast / rd vpn export <>
- router bgp / address-family l2vpn evpn / rd <>
- router bgp / address-family l2vpn evpn / vni <> / rd <>

The vty commands where RD is configured in the below places is
not considered:
- router bgp / rfapi related commands
- router bgp / address-family xxx xxx / network .. rd <>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: support for as notation format for route distinguisher
Philippe Guibert [Tue, 22 Nov 2022 08:57:10 +0000 (09:57 +0100)]
bgpd: support for as notation format for route distinguisher

RD may be built based on an AS number. Like for the AS, the RD
may use the AS notation. The two below examples can illustrate:

RD 1.1:20 stands for an AS4B:NN RD with AS4B=65536 in dot format.
RD 0.1:20 stands for an AS2B:NNNN RD with AS2B=0.1 in dot+ format.

This commit adds the asnotation mode to prefix_rd2str() API so as
to pick up the relevant display.

Two new printfrr extensions are available to display the RD with
the two above display methods.
- The pRDD extension stands for dot asnotation format
- The pRDE extension stands for dot+ asnotation format.
- The pRD extension has been renamed to pRDP extension

The code is changed each time '%pRD' printf extension is called.
Possibly, the asnotation may change the output, then a macro defines
the asnotation mode to use. A side effect of forging the mode to
use is that the string could not be concatenated with other strings
in vty_out and snprintfrr. Those functions have been called multiple
times. When zlog_debug needs to display the RD with some other string,
the prefix_rd2str() old API is used instead of the printf extension.

Some code has been kept untouched:
- code related to running-config. Actually, wherever an RD is displayed,
its configured name should be dumped.
- bgp rfapi code
- bgp evpn multihoming code (partially done), since the logic is
missing to get the asnotation of 'struct bgp_evpn_es'.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: the neighbor as are displayed with as-notation mode
Philippe Guibert [Fri, 18 Nov 2022 15:58:14 +0000 (16:58 +0100)]
bgpd: the neighbor as are displayed with as-notation mode

The as-notation mode of the BGP instance will impact the way
the neighbor AS information is dumped in the show commands.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: store the confederation as identifier as a string
Philippe Guibert [Fri, 18 Nov 2022 15:56:09 +0000 (16:56 +0100)]
bgpd: store the confederation as identifier as a string

The confederation peers as and the confederation identifier as
are stored as a string to preserve the output in the running
configuration.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: store the neighbor as identifier as a string
Philippe Guibert [Fri, 18 Nov 2022 15:02:55 +0000 (16:02 +0100)]
bgpd: store the neighbor as identifier as a string

This identifier is used to display the peer configuration in
the running-config, like it has been configured.
The following commands are using a specific string attribute:
- neighbor .. remote-as ASN
- neighbor .. local-as ASN

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: modify bgp as number output
Philippe Guibert [Fri, 18 Nov 2022 12:49:53 +0000 (13:49 +0100)]
bgpd: modify bgp as number output

A json AS number API is created in order to output a
given AS number. In order to keep backward compatibility,
if the as-notation uses a number, then the json is encoded
as an integer, otherwise the encoding will be a string.

For what is not relevant to running-configuration, the
as-notation mode is the one used for the BGP instance.

Also, the vty completion gets the configured 'as_pretty'
string value, when an user wants to get the available
BGP instances.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: aspath list format binds on as-notation format
Philippe Guibert [Mon, 14 Nov 2022 14:56:40 +0000 (15:56 +0100)]
bgpd: aspath list format binds on as-notation format

Each BGP prefix may have an as-path list attached. A forged
string is stored in the BGP attribute and shows the as-path
list output.

Before this commit, the as-path list output was expressed as
a list of AS values in plain format. Now, if a given BGP instance
uses a specific asnotation, then the output is changed:

new output:
router bgp 1.1 asnotation dot
!
 address-family ipv4 unicast
  network 10.200.0.0/24 route-map rmap
  network 10.201.0.0/24 route-map rmap
  redistribute connected route-map rmap
 exit-address-family
exit
!
route-map rmap permit 1
 set as-path prepend 1.1 5433.55 264564564
exit

ubuntu2004# do show bgp ipv4
BGP table version is 2, local router ID is 10.0.2.15, vrf id 0
Default local pref 100, local AS 1.1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
 *> 4.4.4.4/32       0.0.0.0                  0         32768 1.1 5433.55 4036.61268 ?
 *> 10.0.2.0/24      0.0.0.0                  0         32768 1.1 5433.55 4036.61268 ?
    10.200.0.0/24    0.0.0.0                  0         32768 1.1 5433.55 4036.61268 i
    10.201.0.0/24    0.0.0.0                  0         32768 1.1 5433.55 4036.61268 i

The changes include:
- the aspath structure has a new field: asnotation type
The ashash list will differentiate 2 aspaths using a different
asnotation.
- 3 new printf extensions display the as number in the wished
format: pASP, pASD, pASE for plain, dot, or dot+ format (extended).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: add as-notation keyword to 'router bgp' vty command
Philippe Guibert [Thu, 3 Nov 2022 20:17:57 +0000 (21:17 +0100)]
bgpd: add as-notation keyword to 'router bgp' vty command

A new keyword permits changing the BGP as-notation output:
- [no] router bgp <> [vrf BLABLA] [as-notation [<dot|plain|dot+>]]

At the BGP instance creation, the output will inherit the way the
BGP instance is declared. For instance, the 'router bgp 1.1'
command will configure the output in the dot format. However, if
the client wants to choose an alternate output, he will have to
add the extra command: 'router bgp 1.1 as-notation dot+'.

Also, if the user wants to have plain format, even if the BGP
instance is declared in dot format, the keyword can also be used
for that.

The as-notation output is only taken into account at the BGP
instance creation. In the case where VPN instances are used,
a separate instance may be dynamically created. In that case,
the real as-notation format will be taken into acccount at the
first configuration.

Linking the as-notation format with the BGP instance makes sense,
as the operators want to keep consistency of what they configure.

One technical reason why to link the as-notation output with the
BGP instance creation is that the as-path segment lists stored
in the BGP updates use a string representation to handle aspath
operations (by using regexp for instance). Changing on the fly
the output needs to regenerate this string representation to the
correct format. Linking the configuration to the BGP instance
creation avoids refreshing the BGP updates. A similar mechanism
is put in place in junos too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agolib, bgp: add initial support for asdot format
Philippe Guibert [Wed, 2 Nov 2022 17:17:21 +0000 (18:17 +0100)]
lib, bgp: add initial support for asdot format

AS number can be defined as an unsigned long number, or
two uint16 values separated by a period (.). The possible
valus are:
- usual 32 bit values : [1;2^32 -1]
- <1.65535>.<0.65535> for dot notation
- <0.65535>.<0.65535> for dot+ notation.

The 0.0 value is forbidden when configuring BGP instances
or peer configurations.

A new ASN type is added for parsing in the vty.
The following commands use that new identifier:
- router bgp ..
- bgp confederation ..
- neighbor <> remote-as <>
- neighbor <> local-as <>
- clear ip bgp <>
- route-map / set as-path <>

An asn library is available in lib/ and provides some
services:
- convert an as string into an as number.
- parse an as path list string and extract a number.
- convert an as number into a string.

Also, the bgp tests forge an as_zero_path, and to do that,
an API to relax the possibility to have a 0 as value is
specifically called from the tests.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agobgpd: store the bgp as identifier in the configured as-notation
Philippe Guibert [Tue, 15 Nov 2022 15:42:40 +0000 (16:42 +0100)]
bgpd: store the bgp as identifier in the configured as-notation

This is a preliminary work to handle various ways to configure
a BGP Autonomous System. When creating a BGP instance, the
user may want to define the AS number as a dotted value,
instead of using an integer value.

To handle both cases, an as_pretty char attribute will store
the as number as it has been given to the vtysh command:

router bgp <as number>

Whenever the as integer of the BGP instance was dumped,
the as_pretty original format is used.

The json output reuses the integer value to keep backward
compatibility with old displays.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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 agolib: add copy function for bitfield_t
Hiroki Shirokura [Thu, 30 Dec 2021 13:13:37 +0000 (13:13 +0000)]
lib: add copy function for bitfield_t

Add a function to copy a bitfield_t structure.

Add a ‘void *’ to ‘word_t *’ converstion in bf_init() to avoid the
following error:

> ./lib/bitfield.h: In function ‘bf_copy’:
> ./lib/bitfield.h:75:12: error: request for implicit conversion from ‘void *’ to ‘word_t *’ {aka ‘unsigned int *’} not permitted in C++ [-Werror=c++-compat]
>    (v).data = XCALLOC(MTYPE_BITFIELD, ((v).m * sizeof(word_t)));  \
>             ^
> ./lib/bitfield.h:278:2: note: in expansion of macro ‘bf_init’
>   bf_init(dst, WORD_SIZE * (src.m - 1));
>   ^~~~~~~

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoisisd: add affinity-map support
Louis Scalbert [Mon, 7 Nov 2022 10:16:36 +0000 (11:16 +0100)]
isisd: add affinity-map support

Add the support of the affinity-map command to isisd.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agolib,yang,zebra: add affinity-map support
Louis Scalbert [Thu, 3 Nov 2022 13:30:23 +0000 (14:30 +0100)]
lib,yang,zebra: add affinity-map support

Add the affinity-map global command to zebra. The syntax is:

> affinity-map NAME bit-position (0-1023)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
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 agodoc: update workflow docs for SPDX header
David Lamparter [Thu, 9 Feb 2023 11:41:55 +0000 (12:41 +0100)]
doc: update workflow docs for SPDX header

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago*: remove some leftover license blurbs
David Lamparter [Thu, 9 Feb 2023 11:19:23 +0000 (12:19 +0100)]
*: remove some leftover license blurbs

The regex'ing left some paragraphs that didn't exactly match.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoyang: add SPDX License IDs
David Lamparter [Thu, 9 Feb 2023 11:00:38 +0000 (12:00 +0100)]
yang: add SPDX License IDs

YANG files get to keep their license boilerplate in addition to the SPDX
header, since they are likely to be copied around individually.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agolib: SPDX License ID on skiplist code
David Lamparter [Wed, 8 Feb 2023 14:16:39 +0000 (15:16 +0100)]
lib: SPDX License ID on skiplist code

The skiplist code has a very "colorful" history.  Use the SPDX
"LicenseRef" syntax/notation to track it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago*: auto-convert to SPDX License IDs
David Lamparter [Wed, 8 Feb 2023 12:17:09 +0000 (13:17 +0100)]
*: auto-convert to SPDX License IDs

Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago*: manual SPDX License ID conversions
David Lamparter [Wed, 8 Feb 2023 12:21:36 +0000 (13:21 +0100)]
*: manual SPDX License ID conversions

The files converted in this commit either had some random misspelling or
formatting weirdness that made them escape automated replacement, or
have a particularly "weird" licensing setup (e.g. dual-licensed.)

This also marks a bunch of "public domain" files as SPDX License "NONE".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago*: sort out & explain licenses used in FRR
David Lamparter [Wed, 8 Feb 2023 11:03:28 +0000 (12:03 +0100)]
*: sort out & explain licenses used in FRR

New "introduction" note in `COPYING`, and all the licenses moved into
`doc/licenses/`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>