Commit Graph

33261 Commits

Author SHA1 Message Date
Russ White
ffbff9b515
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
2023-09-19 10:18:14 -04:00
Russ White
fd8b00ed53
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
2023-09-19 10:16:33 -04:00
Russ White
a9a89805ec
Merge pull request #14398 from m-varasteh/ospfd-rfc5709
ospfd: add support for RFC 5709 OSPFv2 HMAC-SHA Cryptographic Authentication
2023-09-19 10:14:14 -04:00
Russ White
1e00784731
Merge pull request #14382 from opensourcerouting/feature/long_lived_graceful_restart_dynamic_capability_split
bgpd: Handle LLGR capability using dynamic capabilities
2023-09-19 10:12:35 -04:00
Russ White
078dc7bd6e
Merge pull request #14350 from FRIDM636/pcep-no-commands
pathd: add no command for pce/pce-config options
2023-09-19 10:08:43 -04:00
Donatas Abraitis
1f5809e44f
Merge pull request #14422 from cscarpitta/bugfix/fix-coverity-isis-srv6
isisd: Fix a bunch of coverity issues in IS-IS
2023-09-19 14:43:22 +03:00
Donatas Abraitis
6cd8f13fac tests: Check if TCP MSS is synced if using a passive neighbor
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-18 22:54:53 +03:00
Donatas Abraitis
81ece63e3e 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>
2023-09-18 22:34:45 +03:00
Mark Stapp
9fc53b1380
Merge pull request #14429 from opensourcerouting/ospf6d-warnfix-20230916
ospf6d: fix uninitialized warnings
2023-09-18 15:16:02 -04:00
Donatas Abraitis
84e14c14dc 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>
2023-09-18 15:54:43 +03:00
Donatas Abraitis
232470f3b7 bgpd: Set TCP MSS for the socket even if the session is set to passive
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-18 15:42:06 +03:00
Donatas Abraitis
41fa35a8f4
Merge pull request #14406 from donaldsharp/pim_debug_fun
pimd: Display oil_parent as a string name of the interface
2023-09-18 11:40:48 +03:00
Donatas Abraitis
5ca175b387
Merge pull request #14431 from idryzhov/zebra-cleanup
zebra: remove duplicated code
2023-09-18 11:06:05 +03:00
Donatas Abraitis
35d97877e1
Merge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet
tools: make --quiet actually suppress output
2023-09-18 11:05:33 +03:00
Donatas Abraitis
1854177392
Merge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_non_default_bgp
bgpd: fix forbiding 'redistribute table' usage on non default instances
2023-09-18 10:09:12 +03:00
Igor Ryzhov
0f4d8c0f87 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>
2023-09-17 22:54:17 +03:00
David Lamparter
55bbef1356 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>
2023-09-16 14:17:24 +02:00
Mahdi Varasteh
f5011cd5dd [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>
2023-09-16 07:38:23 +03:30
Igor Ryzhov
8ce68c623d
Merge pull request #14417 from Jafaral/veth
zebra: fix link update for veth interfaces
2023-09-16 01:03:21 +03:00
Carmine Scarpitta
6ae2a525cf 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>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
9de5b3bf58 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>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
f3b4e6664f 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>
2023-09-15 17:42:04 +02:00
Carmine Scarpitta
95eadb5068 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>
2023-09-15 12:39:45 +02:00
Donatas Abraitis
adb1c9aa51 tests: Check if private ASNs are removed if modified by route-map
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-14 21:52:21 +03:00
Donatas Abraitis
dc6fdaa27e 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>
2023-09-14 21:17:07 +03:00
Donald Sharp
e4e46570f8 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>
2023-09-14 11:45:29 -04:00
Jonas Gorski
312d5ee159 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: 19a99d89f0 ("tools: suppress unuseful warnings during restarting frr")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
2023-09-14 17:20:25 +02:00
Jafar Al-Gharaibeh
d85671181b zebra: fix link update for veth interfaces
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-09-14 09:31:48 -05:00
Farid Mihoub
3b7c33ae74 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>
2023-09-14 12:30:35 +02:00
Farid MIHOUB
b38a50fc95 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>
2023-09-14 12:26:41 +02:00
Donatas Abraitis
75dbd45c55
Merge pull request #14383 from donaldsharp/bgp_coverity_cleanup_early_sept
Bgp coverity cleanup early sept
2023-09-13 21:52:37 +03:00
Donald Sharp
ef31e70702
Merge pull request #14410 from opensourcerouting/fix/keep_su_remote_local
bgpd: Keep remote/local socket unions on BGP start event
2023-09-13 12:12:13 -04:00
Donatas Abraitis
142be67f8c 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>
2023-09-13 13:23:45 +03:00
Philippe Guibert
46d792409c 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>
2023-09-13 12:23:20 +02:00
Russ White
abaa68f213
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
2023-09-13 05:57:49 -04:00
Donatas Abraitis
6bd5afca22 tests: Check if LLGR settings can be changed via BGP dynamic capabilities
LLGR stale-time setting.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-13 11:30:47 +03:00
Donatas Abraitis
7e6ca0742c 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>
2023-09-13 11:30:47 +03:00
Donatas Abraitis
b1b3fc5fe0 bgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers file
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-13 11:30:47 +03:00
Donatas Abraitis
1c70a617f8 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>
2023-09-13 11:30:47 +03:00
Donatas Abraitis
00b365d67f bgpd: Show LLGR timers under show bgp neighbor
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-13 11:30:45 +03:00
Donatas Abraitis
e32fa3edcb
Merge pull request #14400 from louis-6wind/local-no-retain
bgpd: fix import from a local VRF with no bgp retain
2023-09-13 11:23:42 +03:00
Donatas Abraitis
47dc0f1354
Merge pull request #14404 from donaldsharp/snmp_mess_ups
tests: snmp tests sometimes fail with `Unable to bind`
2023-09-13 09:52:19 +03:00
Jafar Al-Gharaibeh
7e43a5bf2e
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
2023-09-12 15:12:15 -05:00
Donald Sharp
afe11d5edf 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>
2023-09-12 13:05:05 -04:00
Donald Sharp
4cf7c2bef3
Merge pull request #14397 from manojvn/mgmt_sb_commands
mgmtd: support bundle commands for mgmt.
2023-09-12 12:05:20 -04:00
Russ White
7159e93f47
Merge pull request #14237 from Keelan10/pbrd-map-leak
pbrd: Free Memory in pbr_map_delete
2023-09-12 11:28:20 -04:00
Mark Stapp
bf4e97c632
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter
Revert "lib: add a frr_each_const macro"
2023-09-12 11:20:50 -04:00
Louis Scalbert
7acdaff7e2 topotests: check route import in bgp_vpnv4_noretain
Check route import in bgp_vpnv4_noretain

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-09-12 15:18:02 +02:00
Louis Scalbert
142c029725 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>
2023-09-12 15:18:02 +02:00
Louis Scalbert
b1c2c70828 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>
2023-09-12 15:17:37 +02:00