]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
18 months agoospfd: a possible fix for TAINTED_SCALAR coverity issues 14451/head
Mahdi Varasteh [Wed, 20 Sep 2023 05:24:25 +0000 (08:54 +0330)]
ospfd: a possible fix for TAINTED_SCALAR coverity issues

Signed-off-by: Mahdi Varasteh <varasteh@amnesh.ir>
19 months agoMerge pull request #14443 from opensourcerouting/coverity-redux-20230919
Donald Sharp [Wed, 20 Sep 2023 00:01:45 +0000 (20:01 -0400)]
Merge pull request #14443 from opensourcerouting/coverity-redux-20230919

lib: constrain hash table "tabshift" both ways

19 months agoMerge pull request #14416 from donaldsharp/oil_parent_wrong
Donatas Abraitis [Tue, 19 Sep 2023 20:53:49 +0000 (23:53 +0300)]
Merge pull request #14416 from donaldsharp/oil_parent_wrong

pimd: Use a better name for oil_parent

19 months agolib: constrain hash table "tabshift" both ways 14443/head
David Lamparter [Tue, 19 Sep 2023 19:03:24 +0000 (21:03 +0200)]
lib: constrain hash table "tabshift" both ways

The previous change to assume() did address the coverity warning about
one direction of the shift in HASH_KEY, let's constrain the other in
HASH_SIZE as well.

To be fair, the hash table *will* break at 1G entries, but at that point
we have other problems RAM-wise.  (Could bump the thing to 64-bit, but
then we need better item hash functions too on every single user.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agopimd: Use a better name for oil_parent 14416/head
Donald Sharp [Thu, 14 Sep 2023 11:18:37 +0000 (07:18 -0400)]
pimd: Use a better name for oil_parent

Use oil_incoming_vif instead of oil_parent.  I had
to go look this up as that I failed to remember that
the linux kernel calls this parent for some bizarre
reason.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14299 from SaiGomathiN/14286
Russ White [Tue, 19 Sep 2023 15:36:04 +0000 (11:36 -0400)]
Merge pull request #14299 from SaiGomathiN/14286

pimd,pim6d: Resolving the YANG datatype Inconsistency for PIM Hello Interval

19 months agoMerge pull request #14414 from opensourcerouting/coverity-assume
Russ White [Tue, 19 Sep 2023 14:19:07 +0000 (10:19 -0400)]
Merge pull request #14414 from opensourcerouting/coverity-assume

lib: another attempt at Coverity false positives

19 months agoMerge pull request #14436 from opensourcerouting/fix/set_mss_for_passive_nodes
Russ White [Tue, 19 Sep 2023 14:18:14 +0000 (10:18 -0400)]
Merge pull request #14436 from opensourcerouting/fix/set_mss_for_passive_nodes

bgpd: Set TCP MSS for the socket even if the session is set to passive

19 months agoMerge pull request #14420 from opensourcerouting/fix/remove_private_asn_after_route_map
Russ White [Tue, 19 Sep 2023 14:16:33 +0000 (10:16 -0400)]
Merge pull request #14420 from opensourcerouting/fix/remove_private_asn_after_route_map

bgpd: Remove private ASNs after we modify the as-path with the route-map

19 months agoMerge pull request #14398 from m-varasteh/ospfd-rfc5709
Russ White [Tue, 19 Sep 2023 14:14:14 +0000 (10:14 -0400)]
Merge pull request #14398 from m-varasteh/ospfd-rfc5709

ospfd: add support for RFC 5709 OSPFv2 HMAC-SHA Cryptographic Authentication

19 months agoMerge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_...
Russ White [Tue, 19 Sep 2023 14:12:35 +0000 (10:12 -0400)]
Merge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_dynamic_capability_split

bgpd: Handle LLGR capability using dynamic capabilities

19 months agoMerge pull request #14350 from FRIDM636/pcep-no-commands
Russ White [Tue, 19 Sep 2023 14:08:43 +0000 (10:08 -0400)]
Merge pull request #14350 from FRIDM636/pcep-no-commands

pathd: add no command for pce/pce-config options

19 months agoMerge pull request #14422 from cscarpitta/bugfix/fix-coverity-isis-srv6
Donatas Abraitis [Tue, 19 Sep 2023 11:43:22 +0000 (14:43 +0300)]
Merge pull request #14422 from cscarpitta/bugfix/fix-coverity-isis-srv6

isisd: Fix a bunch of coverity issues in IS-IS

19 months agotests: Check if TCP MSS is synced if using a passive neighbor 14436/head
Donatas Abraitis [Mon, 18 Sep 2023 19:54:53 +0000 (22:54 +0300)]
tests: Check if TCP MSS is synced if using a passive neighbor

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Set TCP min MSS per listener
Donatas Abraitis [Mon, 18 Sep 2023 19:34:45 +0000 (22:34 +0300)]
bgpd: Set TCP min MSS per listener

Set only if at least one peer is in passive mode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14429 from opensourcerouting/ospf6d-warnfix-20230916
Mark Stapp [Mon, 18 Sep 2023 19:16:02 +0000 (15:16 -0400)]
Merge pull request #14429 from opensourcerouting/ospf6d-warnfix-20230916

ospf6d: fix uninitialized warnings

19 months agobgpd: Show TCP MSS per neighbor always, despite if it's configured or not
Donatas Abraitis [Mon, 18 Sep 2023 12:54:43 +0000 (15:54 +0300)]
bgpd: Show TCP MSS per neighbor always, despite if it's configured or not

To show the TCP MSS value per neighbor you have to configure it, otherwise you
don't see the actual value.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Set TCP MSS for the socket even if the session is set to passive
Donatas Abraitis [Fri, 15 Sep 2023 11:05:41 +0000 (14:05 +0300)]
bgpd: Set TCP MSS for the socket even if the session is set to passive

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14406 from donaldsharp/pim_debug_fun
Donatas Abraitis [Mon, 18 Sep 2023 08:40:48 +0000 (11:40 +0300)]
Merge pull request #14406 from donaldsharp/pim_debug_fun

pimd: Display oil_parent as a string name of the interface

19 months agoMerge pull request #14431 from idryzhov/zebra-cleanup
Donatas Abraitis [Mon, 18 Sep 2023 08:06:05 +0000 (11:06 +0300)]
Merge pull request #14431 from idryzhov/zebra-cleanup

zebra: remove duplicated code

19 months agoMerge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet
Donatas Abraitis [Mon, 18 Sep 2023 08:05:33 +0000 (11:05 +0300)]
Merge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet

tools: make --quiet actually suppress output

19 months agoMerge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_non_defau...
Donatas Abraitis [Mon, 18 Sep 2023 07:09:12 +0000 (10:09 +0300)]
Merge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_non_default_bgp

bgpd: fix forbiding 'redistribute table' usage on non default instances

19 months agozebra: remove duplicated code 14431/head
Igor Ryzhov [Sun, 17 Sep 2023 19:34:51 +0000 (22:34 +0300)]
zebra: remove duplicated code

The same thing is done in zebra_if_update_link a couple of lines above.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
19 months agoospf6d: fix uninitialized warnings 14429/head
David Lamparter [Sat, 16 Sep 2023 12:17:24 +0000 (14:17 +0200)]
ospf6d: fix uninitialized warnings

GCC 13.2.0 complains:

```
ospf6d/ospf6_intra.c:139:25: error: ‘json_arr’ may be used uninitialized [-Werror=maybe-uninitialized]
ospf6d/ospf6_intra.c:485:20: error: ‘json_arr’ may be used uninitialized [-Werror=maybe-uninitialized]
```

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months ago[ospfd]: add support for RFC 5709 HMAC-SHA Auth 14398/head
Mahdi Varasteh [Tue, 12 Sep 2023 11:39:44 +0000 (15:09 +0330)]
[ospfd]: add support for RFC 5709 HMAC-SHA Auth

This patch includes:
* Implementation of RFC 5709 support in OSPF. Using
openssl library and FRR key-chain,
one can use SHA1, SHA256, SHA384, SHA512 and
keyed-MD5( backward compatibility with RFC 2328) HMAC algs.
* Updating documentation of OSPF
* add topotests for new HMAC algorithms

Signed-off-by: Mahdi Varasteh <varasteh@amnesh.ir>
19 months agoMerge pull request #14417 from Jafaral/veth
Igor Ryzhov [Fri, 15 Sep 2023 22:03:21 +0000 (01:03 +0300)]
Merge pull request #14417 from Jafaral/veth

zebra: fix link update for veth interfaces

19 months agoisisd: Fix CID 1568134 (Null pointer dereference) 14422/head
Carmine Scarpitta [Fri, 15 Sep 2023 10:36:30 +0000 (12:36 +0200)]
isisd: Fix CID 1568134 (Null pointer dereference)

Null check `isis` pointer before dereferencing it.

Fixes this coverity issue:

*** CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
/isisd/isis_zebra.c: 1146 in isis_zebra_process_srv6_locator_chunk()
1140                    "prefix %pFX, block_len %u, node_len %u, func_len %u, arg_len %u",
1141                    chunk->locator_name, &chunk->prefix, chunk->block_bits_length,
1142                    chunk->node_bits_length, chunk->function_bits_length,
1143                    chunk->argument_bits_length);
1144
1145            /* Walk through all areas of the ISIS instance */
>>>     CID 1568134:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "isis", which is known to be "NULL".
1146            for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
1147                    if (strncmp(area->srv6db.config.srv6_locator_name,
1148                                chunk->locator_name,
1149                                sizeof(area->srv6db.config.srv6_locator_name)) != 0)
1150                            continue;
1151

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568133 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:30:39 +0000 (12:30 +0200)]
isisd: Fix CID 1568133 (Null pointer dereference)

Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1077 in isis_zebra_srv6_adj_sid_uninstall()
1071            enum seg6local_action_t action = ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
1072            struct interface *ifp;
1073            uint16_t prefixlen = IPV6_MAX_BITLEN;
1074            struct isis_circuit *circuit = sra->adj->circuit;
1075            struct isis_area *area = circuit->area;
1076
>>>     CID 1568133:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1077            if (!sra)
1078                    return;
1079
1080            switch (sra->behavior) {
1081            case SRV6_ENDPOINT_BEHAVIOR_END_X:
1082                    prefixlen = IPV6_MAX_BITLEN;

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568132 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:25:50 +0000 (12:25 +0200)]
isisd: Fix CID 1568132 (Null pointer dereference)

Null checking the `sra` pointer after dereferencing it causes a
coverity issue. Let's perform the null check before dereferencing the
pointer.

Fixes this coverity issue:

*** CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_zebra.c: 1023 in isis_zebra_srv6_adj_sid_install()
1017            struct seg6local_context ctx = {};
1018            uint16_t prefixlen = IPV6_MAX_BITLEN;
1019            struct interface *ifp;
1020            struct isis_circuit *circuit = sra->adj->circuit;
1021            struct isis_area *area = circuit->area;
1022
>>>     CID 1568132:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sra" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1023            if (!sra)
1024                    return;
1025
1026            sr_debug("ISIS-SRv6 (%s): setting adjacency SID %pI6", area->area_tag,
1027                     &sra->sid);
1028

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agoisisd: Fix CID 1568129 (Null pointer dereference)
Carmine Scarpitta [Fri, 15 Sep 2023 10:13:45 +0000 (12:13 +0200)]
isisd: Fix CID 1568129 (Null pointer dereference)

Fix this coverity issue:

*** CID 1568129:  Null pointer dereferences  (REVERSE_INULL)
/isisd/isis_tlvs.c: 2813 in unpack_item_srv6_end_sid()
2807                    sid->subsubtlvs = NULL;
2808            }
2809
2810            append_item(&subtlvs->srv6_end_sids, (struct isis_item *)sid);
2811            return 0;
2812     out:
>>>     CID 1568129:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "sid" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2813            if (sid)
2814                    free_item_srv6_end_sid((struct isis_item *)sid);
2815            return 1;
2816     }
2817
2818     /* Functions related to TLVs 1 Area Addresses */

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
19 months agotests: Check if private ASNs are removed if modified by route-map 14420/head
Donatas Abraitis [Thu, 14 Sep 2023 18:52:21 +0000 (21:52 +0300)]
tests: Check if private ASNs are removed if modified by route-map

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Remove private ASNs after we modify the as-path with the route-map
Donatas Abraitis [Thu, 14 Sep 2023 18:17:07 +0000 (21:17 +0300)]
bgpd: Remove private ASNs after we modify the as-path with the route-map

If we modify as-path with route-map and prepend with private ASNs, then we
advertise a new as-path without stripping private ASNs. Let's fix this, and
remove private ASNs despite if they were sent by the origin or prepended locally.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agopimd: Display oil_parent as a string name of the interface 14406/head
Donald Sharp [Tue, 12 Sep 2023 22:19:23 +0000 (18:19 -0400)]
pimd: Display oil_parent as a string name of the interface

When debugging and outputting the oil_parent() let's just
convert it to a string that is useful for people trying
to debug pim

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agotools: make --quiet actually suppress output 14418/head
Jonas Gorski [Thu, 14 Sep 2023 15:04:16 +0000 (17:04 +0200)]
tools: make --quiet actually suppress output

When calling daemon_stop() with --quiet and e.g. the pidfile is empty,
it won't return early since while "$fail" is set, "$2" is "--quiet", so
the if condition isn't met and it will continue executing, resulting
in error messages in the log:

> Sep 14 14:48:33 localhost watchfrr[2085]: [YFT0P-5Q5YX] Forked background command [pid 2086]: /usr/lib/frr/watchfrr.sh restart all
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec
> Sep 14 14:48:33 localhost frrinit.sh[2075]: /usr/lib/frr/frrcommon.sh: line 216: kill: `': not a pid or valid job spec

Fix this by moving the --quiet check into the block to log_failure_msg(),
and also add the check to all other invocations of log_*_msg() to make
--quiet properly suppress output.

Fixes: 19a99d89f088 ("tools: suppress unuseful warnings during restarting frr")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
19 months agozebra: fix link update for veth interfaces 14417/head
Jafar Al-Gharaibeh [Thu, 14 Sep 2023 14:24:25 +0000 (09:24 -0500)]
zebra: fix link update for veth interfaces

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
19 months agopathd: reset pcc peer connection when pce options modified 14350/head
Farid Mihoub [Wed, 30 Aug 2023 12:32:43 +0000 (14:32 +0200)]
pathd: reset pcc peer connection when pce options modified

Reset the PCC peer connection to take into account new changes of the
PCE options.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
19 months agopathd: add no command for pce/pce-config sub-commands
Farid MIHOUB [Thu, 24 Aug 2023 08:23:01 +0000 (10:23 +0200)]
pathd: add no command for pce/pce-config sub-commands

Add "no" command for pcep pce/pce-config sub-commands, this will mainly
restart configured options to default values.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
19 months agolib: another attempt at Coverity false positives 14414/head
David Lamparter [Thu, 14 Sep 2023 09:43:56 +0000 (11:43 +0200)]
lib: another attempt at Coverity false positives

Typesafe hash tables do this:

assume((tabshift) >= 2 && (tabshift) <= 33);
(val) >> (33 - (tabshift));

Sadly, Coverity currently ignores assume() and says:
[...] right shifting by more than 31 bits has undefined behavior.
The shift amount, "33 - h->hh.tabshift", is 33.

Let's see if Coverity understands this can't happen...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 months agoMerge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept
Donatas Abraitis [Wed, 13 Sep 2023 18:52:37 +0000 (21:52 +0300)]
Merge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept

Bgp coverity cleanup early sept

19 months agoMerge pull request #14410 from opensourcerouting/fix/keep_su_remote_local
Donald Sharp [Wed, 13 Sep 2023 16:12:13 +0000 (12:12 -0400)]
Merge pull request #14410 from opensourcerouting/fix/keep_su_remote_local

bgpd: Keep remote/local socket unions on BGP start event

19 months agobgpd: Keep remote/local socket unions on BGP start event 14410/head
Donatas Abraitis [Wed, 13 Sep 2023 10:21:47 +0000 (13:21 +0300)]
bgpd: Keep remote/local socket unions on BGP start event

Not sure why this is needed, because it's reset on bgp_connect_success(),
when the session is UP.

When the session is reset, it clears those variables, and we are not able to
see what remote address was before, etc.

hostLocal, hostRemote reports Unknown for `show bgp neighbor json`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: fix forbiding 'redistribute table' usage on non default instances 14409/head
Philippe Guibert [Wed, 13 Sep 2023 09:36:23 +0000 (11:36 +0200)]
bgpd: fix forbiding 'redistribute table' usage on non default instances

The 'redistribute table' command can be used by configuration on a
non default BGP instance, but this command does not work for multiple
reasons:
- The route entries configured on a given table are always configured
from the default vrf. This constraint prevents from redistributing a
prefix from the default vrf to an other non default bgp instance.
- The importation of route entries requires 'ip import-table' on vrfs
and this command is not available

Fix this by preventing from configuring this kind of redistribution
on non default bgp instances.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
19 months agoMerge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_defa...
Russ White [Wed, 13 Sep 2023 09:57:49 +0000 (05:57 -0400)]
Merge pull request #14162 from opensourcerouting/feature/turn_on_nht_resolve_via_default_for_traditional_profile

zebra: Turn on `nht resolve-via-default` by default for traditional profile

19 months agotests: Check if LLGR settings can be changed via BGP dynamic capabilities 14382/head
Donatas Abraitis [Thu, 7 Sep 2023 07:23:26 +0000 (10:23 +0300)]
tests: Check if LLGR settings can be changed via BGP dynamic capabilities

LLGR stale-time setting.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Handle LLGR capability using dynamic capabilities
Donatas Abraitis [Thu, 7 Sep 2023 07:21:45 +0000 (10:21 +0300)]
bgpd: Handle LLGR capability using dynamic capabilities

LLGR stale time is exchanged using OPEN messages. In order to
reduce stal time before doing an actual graceful restart + LLGR, it might be useful
to increase the time, but this is not possible without resetting the session.

With this change, it's possible to send dynamic capability with a new value, and
GR will respect a new reset time value when LLGR kicks in.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers file
Donatas Abraitis [Thu, 7 Sep 2023 07:17:52 +0000 (10:17 +0300)]
bgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers file

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Use explicit data types for graceful_restart_af struct
Donatas Abraitis [Thu, 7 Sep 2023 07:16:22 +0000 (10:16 +0300)]
bgpd: Use explicit data types for graceful_restart_af struct

afi/safi comes as integers, but we should decode them as uint16/uint8
accordingly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agobgpd: Show LLGR timers under `show bgp neighbor`
Donatas Abraitis [Thu, 7 Sep 2023 07:14:45 +0000 (10:14 +0300)]
bgpd: Show LLGR timers under `show bgp neighbor`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agoMerge pull request #14400 from louis-6wind/local-no-retain
Donatas Abraitis [Wed, 13 Sep 2023 08:23:42 +0000 (11:23 +0300)]
Merge pull request #14400 from louis-6wind/local-no-retain

bgpd: fix import from a local VRF with no bgp retain

19 months agoMerge pull request #14404 from donaldsharp/snmp_mess_ups
Donatas Abraitis [Wed, 13 Sep 2023 06:52:19 +0000 (09:52 +0300)]
Merge pull request #14404 from donaldsharp/snmp_mess_ups

tests: snmp tests sometimes fail with `Unable to bind`

19 months agoMerge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR
Jafar Al-Gharaibeh [Tue, 12 Sep 2023 20:12:15 +0000 (15:12 -0500)]
Merge pull request #14399 from opensourcerouting/fix/bgpd_handle_BGP_MAX_ATTR

bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr

19 months agotests: snmp tests sometimes fail with `Unable to bind` 14404/head
Donald Sharp [Tue, 12 Sep 2023 17:05:05 +0000 (13:05 -0400)]
tests: snmp tests sometimes fail with `Unable to bind`

the snmp tests are using zebra.conf to setup the
address that they are binding to and immediately
after that they are starting snmpd.  If snmpd
starts up *before* zebra has installed the address
the bind on the address will fail.  Causing the entire
test to fail.  Modify the snmpd.conf for all our
snmp tests to bind to all addresses.  Things still
work and we no longer have an issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
19 months agoMerge pull request #14397 from manojvn/mgmt_sb_commands
Donald Sharp [Tue, 12 Sep 2023 16:05:20 +0000 (12:05 -0400)]
Merge pull request #14397 from manojvn/mgmt_sb_commands

mgmtd: support bundle commands for mgmt.

19 months agoMerge pull request #14237 from Keelan10/pbrd-map-leak
Russ White [Tue, 12 Sep 2023 15:28:20 +0000 (11:28 -0400)]
Merge pull request #14237 from Keelan10/pbrd-map-leak

pbrd: Free Memory in pbr_map_delete

19 months agoMerge pull request #14365 from opensourcerouting/typesafe-const-declutter
Mark Stapp [Tue, 12 Sep 2023 15:20:50 +0000 (11:20 -0400)]
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter

Revert "lib: add a frr_each_const macro"

19 months agotopotests: check route import in bgp_vpnv4_noretain 14400/head
Louis Scalbert [Tue, 12 Sep 2023 11:30:57 +0000 (13:30 +0200)]
topotests: check route import in bgp_vpnv4_noretain

Check route import in bgp_vpnv4_noretain

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agotopotest: fix bgp_vpnv4_noretain test descriptions
Louis Scalbert [Tue, 12 Sep 2023 11:57:50 +0000 (13:57 +0200)]
topotest: fix bgp_vpnv4_noretain test descriptions

Fix bgp_vpnv4_noretain test descriptions

Fixes: 22dfa04b78 ("topotests: more tests in bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agobgpd: fix vpn import from local vrf with no retain
Louis Scalbert [Mon, 11 Sep 2023 16:33:23 +0000 (18:33 +0200)]
bgpd: fix vpn import from local vrf with no retain

The BGP "no retain" VPN option avoids storing VPN prefixes that are not
imported in the incoming BGP table (aka. Adj RIB in). When a VPN import
policy is changed, BGP does a soft clear so that a prefix refresh is
requested from the peers. However, the import from local VPN prefixes
is never requested.

Fix this issue by requesting a local import refresh.

Fixes: a486300b26 ("bgpd: implement retain route-target all behaviour")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
19 months agoMerge pull request #14379 from donaldsharp/peer_connection_part_two
Russ White [Tue, 12 Sep 2023 12:51:50 +0000 (08:51 -0400)]
Merge pull request #14379 from donaldsharp/peer_connection_part_two

Peer connection part two

19 months agoMerge pull request #14348 from opensourcerouting/fpm-rr
Russ White [Tue, 12 Sep 2023 12:45:14 +0000 (08:45 -0400)]
Merge pull request #14348 from opensourcerouting/fpm-rr

zebra: support route replace semantic in FPM

19 months agoMerge pull request #13724 from cscarpitta/feature/isisd-srv6-support
Russ White [Tue, 12 Sep 2023 12:33:42 +0000 (08:33 -0400)]
Merge pull request #13724 from cscarpitta/feature/isisd-srv6-support

isisd: Add support for SRv6 uSID (RFC 9352)

19 months agobgpd: BGP_ATTR_MAX can be 255, allow using it for path attr discard/withdraw cmds 14399/head
Donatas Abraitis [Tue, 12 Sep 2023 11:46:11 +0000 (14:46 +0300)]
bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr discard/withdraw cmds

https://www.rfc-editor.org/rfc/rfc2042.html

says: 255 reserved for development

In FRR, 255 is kinda used too BGP_ATTR_VNC, even more we allow setting 255 in CLI.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
19 months agomgmtd: support bundle commands for mgmt daemon. 14397/head
Manoj Naragund [Tue, 12 Sep 2023 08:53:04 +0000 (01:53 -0700)]
mgmtd: support bundle commands for mgmt daemon.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
19 months agodoc: Add documentation for IS-IS SRv6 features 13724/head
Carmine Scarpitta [Sat, 3 Jun 2023 11:53:33 +0000 (13:53 +0200)]
doc: Add documentation for IS-IS SRv6 features

Add documentation for IS-IS SRv6 functionalities (RFC 9352)

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agotests: Add `isis_srv6_topo1` test for IS-IS SRv6
Carmine Scarpitta [Tue, 13 Dec 2022 15:15:21 +0000 (16:15 +0100)]
tests: Add `isis_srv6_topo1` test for IS-IS SRv6

Add a new topotest `isis_srv6_topo1` for verifying SRv6 functionalities
in IS-IS (RFC 9352).

This topotest consists of nine tests:

* Network convergence after applying SRv6 configuration
* Disable SRv6 Locator on zebra on r1
* Enable SRv6 Locator on zebra on r1
* Disable SRv6 Locator on ISIS on r1
* Enable SRv6 Locator on ISIS on r1
* Disable SRv6 on ISIS on r1
* Enable SRv6 on ISIS on r1
* Disable SRv6 on zebra on r1
* Enable SRv6 on zebra on r1

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agotests: Update fuzz test to match expected output
Carmine Scarpitta [Mon, 12 Jun 2023 16:58:34 +0000 (18:58 +0200)]
tests: Update fuzz test to match expected output

Update IS-IS fuzz test to match corrected output after the introduction
of SRv6-related TLVs.

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make SRv6 interface configurable
Carmine Scarpitta [Sun, 3 Sep 2023 06:54:57 +0000 (08:54 +0200)]
isisd: Make SRv6 interface configurable

Add CLI command and functions to configure the interface used for
installing SRv6 SIDs into Linux data plane

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoyang: Add SRv6 interface to IS-IS YANG model
Carmine Scarpitta [Sun, 3 Sep 2023 17:21:50 +0000 (19:21 +0200)]
yang: Add SRv6 interface to IS-IS YANG model

Add SRv6 interface to the IS-IS YANG model

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make SRv6 Node MSDs customizable
Carmine Scarpitta [Fri, 4 Aug 2023 06:11:46 +0000 (08:11 +0200)]
isisd: Make SRv6 Node MSDs customizable

Add CLI commands to customize SRv6 Node MSD values.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoyang: Add SRv6 MSDs to IS-IS YANG model
Carmine Scarpitta [Fri, 4 Aug 2023 06:13:58 +0000 (08:13 +0200)]
yang: Add SRv6 MSDs to IS-IS YANG model

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agovtysh: Add CLI nodes for SRv6
Carmine Scarpitta [Fri, 4 Aug 2023 06:13:14 +0000 (08:13 +0200)]
vtysh: Add CLI nodes for SRv6

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agolib: Add CLI node for SRv6 Node MSD
Carmine Scarpitta [Fri, 4 Aug 2023 06:12:54 +0000 (08:12 +0200)]
lib: Add CLI node for SRv6 Node MSD

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Remove SIDs when parent locator is deleted
Carmine Scarpitta [Tue, 30 May 2023 16:55:44 +0000 (18:55 +0200)]
isisd: Remove SIDs when parent locator is deleted

Clean up SRv6 SIDs when the parent locator is deleted.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Initialize/free SRv6 adjacency SIDs list
Carmine Scarpitta [Sat, 3 Jun 2023 00:21:30 +0000 (02:21 +0200)]
isisd: Initialize/free SRv6 adjacency SIDs list

Initialize/free SRv6 adjacency SIDs list when an IS-IS area is
created/destroyed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Extend `sid_exist` to consider adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 11:39:15 +0000 (13:39 +0200)]
isisd: Extend `sid_exist` to consider adj SIDs

The function `sid_exist` verifies if a given SRv6 SID has already been
allocated for a given IS-IS area. This commit extends `sid_exist` to
also consider adjacency SIDs when checking for the existence of the SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Extend IS-IS adjacency with SRv6 adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 00:14:42 +0000 (02:14 +0200)]
isisd: Extend IS-IS adjacency with SRv6 adj SIDs

Initialize/remove SRv6 SIDs list when an IS-IS adjacency is
created/deleted.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add support for SRv6 Adjacency SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 00:08:08 +0000 (02:08 +0200)]
isisd: Add support for SRv6 Adjacency SIDs

An SRv6 adjacency SID is a SID that is associated with a particular
adjacency. Adjacency SIDs are advertised using the SRv6 End.X SID
Sub-TLV (RFC 9352 section #8.1) or SRv6 LAN End.X SID Sub-TLV (RFC 9352
section #8.2).

This commit defines the following Adj SIDs management functions:
* srv6_endx_sid_add_single: add a new SRv6 Adjacency SID
* srv6_endx_sid_del: delete an SRv6 Adjacency SID
* isis_srv6_endx_sid_find: lookup SRv6 End.X SID by type

It also attaches some callbacks to the hooks isis_adj_state_change_hook,
isis_adj_ip_enabled_hook, isis_adj_ip_disabled_hook, which are
responsible for installing/removing an SRv6 Adjacency SID automatically
when the state of an IS-IS adjacency changes.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add functions to install/remove adj SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 06:41:50 +0000 (08:41 +0200)]
isisd: Add functions to install/remove adj SIDs

Add two functions to install/remove Adjacency SIDs into the data plane
through zebra.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add data structure for SRv6 Adjacency SIDs
Carmine Scarpitta [Sat, 3 Jun 2023 20:06:04 +0000 (22:06 +0200)]
isisd: Add data structure for SRv6 Adjacency SIDs

An SRv6 adjacency SID is a SID that is associated with a particular
adjacency. Adjacency SIDs are advertised using the SRv6 End.X SID
Sub-TLV (RFC 9352 section #8.1) or SRv6 LAN End.X SID Sub-TLV (RFC 9352
section #8.2).

This commit defines a data structure `srv6_adjacency` for storing
information about an SRv6 Adjacency SID. This data structure will be
used to support SRv6 Adjacency SIDs functionalities in future commits.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Make MTYPE_ISIS_SUBSUBTLV non-static
Carmine Scarpitta [Sat, 3 Jun 2023 00:22:02 +0000 (02:22 +0200)]
isisd: Make MTYPE_ISIS_SUBSUBTLV non-static

We need to allocate memory SRv6 SID Structure Sub-Sub-TLV in
isis_srv6.c. MTYPE_ISIS_SUBSUBTLV is statically defined in isis_tlvs.c
and therefore is not visible in isis_srv6.c. Let's make
MTYPE_ISIS_SUBSUBTLV non-static to provide visibility to the external
world..

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Unpack SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Thu, 25 May 2023 13:21:50 +0000 (15:21 +0200)]
isisd: Unpack SRv6 (LAN) End.X SID Sub-TLV

Extend the Extended IS Reachability TLV unpack function to unpack the
SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Pack SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Sat, 3 Jun 2023 00:39:07 +0000 (02:39 +0200)]
isisd: Pack SRv6 (LAN) End.X SID Sub-TLV

Extend the Extended IS Reachability TLV pack function to pack the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 (LAN) End.X SID Sub-TLV codepoints
Carmine Scarpitta [Thu, 25 May 2023 12:50:00 +0000 (14:50 +0200)]
isisd: Add SRv6 (LAN) End.X SID Sub-TLV codepoints

Add SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV codepoints
(defined in "IS-IS Sub-TLVs for TLVs Advertising Neighbor Information"
IANA registry). These codepoints will be used in future commits to
pack/unpack corresponding Sub-TLVs.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to Sub-TLV format func
Carmine Scarpitta [Sat, 3 Jun 2023 00:31:05 +0000 (02:31 +0200)]
isisd: Add SRv6 End.X SID to Sub-TLV format func

Extend the Extended IS Reachability TLV format function to show the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add flags for SRv6 (LAN) End.X SID Sub-TLV
Carmine Scarpitta [Thu, 25 May 2023 11:03:15 +0000 (13:03 +0200)]
isisd: Add flags for SRv6 (LAN) End.X SID Sub-TLV

SRv6 End.X SID Sub-TLV (RFC 9352 section #8.1) and SRv6 LAN End.X SID
Sub-TLV (RFC 9352 section #8.2) contain a `flag` field. Currently, three
flags are defined:
* B-Flag: Backup flag
* S-Flag: Set flag
* P-Flag: Persistent flag

This commit defines three constants representing these flags.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to Sub-TLV copy func
Carmine Scarpitta [Sat, 3 Jun 2023 00:37:07 +0000 (02:37 +0200)]
isisd: Add SRv6 End.X SID to Sub-TLV copy func

Extend the Extended IS Reachability TLV copy function to copy the SRv6
End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV, if present.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID to IS ext reach Sub-TLVs
Carmine Scarpitta [Thu, 25 May 2023 10:13:33 +0000 (12:13 +0200)]
isisd: Add SRv6 End.X SID to IS ext reach Sub-TLVs

Add SRv6 End.X SID Sub-TLV and SRv6 LAN End.X SID Sub-TLV to the
Extended IS Reachability Sub-TLVs data structure and perform proper
initialization/free when the Sub-TLVs data structure is
allocated/destroyed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 LAN End.X SID Sub-TLV data struct
Carmine Scarpitta [Thu, 25 May 2023 09:50:18 +0000 (11:50 +0200)]
isisd: Add SRv6 LAN End.X SID Sub-TLV data struct

Add a data structure to represent an SRv6 LAN End.X SID Sub-TLV as per
RFC 9352 section #8.2.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 End.X SID Sub-TLV data structure
Carmine Scarpitta [Thu, 25 May 2023 09:49:47 +0000 (11:49 +0200)]
isisd: Add SRv6 End.X SID Sub-TLV data structure

Add a data structure to represent an SRv6 End.X SID Sub-TLV as per
RFC 9352 section #8.1.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Update copyright info in isis_tlvs.[c,h]
Carmine Scarpitta [Sat, 18 Feb 2023 00:36:32 +0000 (01:36 +0100)]
isisd: Update copyright info in isis_tlvs.[c,h]

Add copyright claim for "IS-IS Extensions to Support SRv6" (RFC 9352)
to isis_tlvs.c and isis_tlvs.h.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Advertise SRv6 Locator in Prefix Reach TLV
Carmine Scarpitta [Tue, 6 Dec 2022 20:54:25 +0000 (21:54 +0100)]
isisd: Advertise SRv6 Locator in Prefix Reach TLV

According to RFC 9352 section #5, the SRv6 Locators associated with
algorithms 0 and 1 should be also advertised in a Prefix Reachability
TLV (236 or 237) to allow legacy routers (i.e., routers that do not
support SRv6) installing a forwarding entry for algorithms 0 and 1 SRv6
traffic.

This commits extend IS-IS to advertise SRv6 Locators in IPv6
Reachability TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add SRv6 Locator TLV to the LSP
Carmine Scarpitta [Wed, 22 Feb 2023 00:25:12 +0000 (01:25 +0100)]
isisd: Add SRv6 Locator TLV to the LSP

Add the SRv6 Locator TLV and its Sub-TLV and Sub-Sub-TLVs to the LSP.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add structure when building End SID Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 11:27:53 +0000 (12:27 +0100)]
isisd: Add structure when building End SID Sub-TLV

Encode SRv6 SID Structure Sub-Sub-TLV when building the SRv6 End SID
Sub-TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to build Sub-Sub-TLV from End SID
Carmine Scarpitta [Wed, 15 Feb 2023 11:00:24 +0000 (12:00 +0100)]
isisd: Add func to build Sub-Sub-TLV from End SID

Add a function to build an SRv6 SID Structure Sub-Sub-TLV (RFC 9352
section #9) to advertise the structure of a specific SRv6 End SID passed
as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add End SID when building SRv6 Locator TLV
Carmine Scarpitta [Thu, 16 Mar 2023 09:24:04 +0000 (10:24 +0100)]
isisd: Add End SID when building SRv6 Locator TLV

Encode SRv6 End SID Sub-TLVs when building the SRv6 Locator TLV.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to build Sub-TLV from SRv6 End SID
Carmine Scarpitta [Wed, 15 Feb 2023 11:15:45 +0000 (12:15 +0100)]
isisd: Add func to build Sub-TLV from SRv6 End SID

Add a function to build an SRv6 End SID TLV (RFC 9352 section #7.2) to
advertise a specific SRv6 End SID passed as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add function to build TLV from SRv6 Locator
Carmine Scarpitta [Fri, 24 Feb 2023 21:27:25 +0000 (22:27 +0100)]
isisd: Add function to build TLV from SRv6 Locator

Add a function to build an SRv6 Locator TLV (RFC 9352 section #7.1) to
advertise a specific SRv6 Locator passed as an argument.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to fill in SID Struct Sub-Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:49:11 +0000 (11:49 +0100)]
isisd: Add func to fill in SID Struct Sub-Sub-TLV

Add a function to fill in an SRv6 SID Structure Sub-Sub-TLV with
information from an SRv6 SID (RFC 9352 section #9).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add func to fill in an SRv6 End SID Sub-TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:43:03 +0000 (11:43 +0100)]
isisd: Add func to fill in an SRv6 End SID Sub-TLV

Add a function to fill in an SRv6 End SID Sub-TLV with information from
an SRv6 End SID (RFC 9352 section #7.2).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
19 months agoisisd: Add function to fill in an SRv6 Locator TLV
Carmine Scarpitta [Wed, 15 Feb 2023 10:35:46 +0000 (11:35 +0100)]
isisd: Add function to fill in an SRv6 Locator TLV

Add a function to fill in an SRv6 Locator TLV with information from an
SRv6 locator (RFC 9352 section #7.1).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>