Commit Graph

35139 Commits

Author SHA1 Message Date
Christian Hopps
408ee24e41 lib: create and use libyang tree during oper-state walk
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
d58653a5ba lib: northbound: improve xpath functionality
Allow user to leave keys off of a list entry node at the end of the xpath. This
will return all list entries. Previously there was no way to just get the list
entries. One had to leave off the last list entry node which would then return
all list nodes as well as all the siblings at the same level.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
db0211d48a lib: yang: add new functions
- yang_get_key_preds
- yang_lyd_new_list

A function like new_list was added recently to libyang,
this is a compat version.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
f3d6edc7ee lib: darr: add new access and str functions
- darr_last(), and darr_strdup_cap().
- strcat, strdup, strlen, strnul equivs.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
1bb6f21208 tests: add debugs and count in static_simple test
Also add option to use unified config.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
9cd8693363 mgmtd: step 6: remove old unfinished get-data code
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Christian Hopps
8df542b219 mgmtd: step 5: add get-tree txn functionality
Adds the guts of the get-tree functionality that is called by or calls
the FE and BE code for get-tree processing.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Christian Hopps
be2424a875 mgmtd: step 4: FE adapter get-tree functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Christian Hopps
33b9c2ef00 mgmtd: step 3: BE adapter native message handling
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Christian Hopps
4fee273e9c lib: step 2: mgmtd: BE client code for get-tree functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Christian Hopps
772f6c07c7 lib: step 1: mgmtd: add FE get-tree functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 10:41:54 +00:00
Chirag Shah
42949edb10 bgpd: lttng tp add ethtag to macip zebra send
Ticket:#3597393
Testing Done:

2023-09-08T17:33:03.731 frr_bgp:evpn_mac_ip_zsend {'action': 'add',
'vni': 1003, 'eth_tag': 968006412, 'mac': '00:02:00:00:00:40', 'ip': '',
'vtep': '27.0.0.16', 'esi': '00:00:00:00:00:00:00:00:00:00'}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-12-27 18:01:50 -08:00
Mark Stapp
39b8872941 bgpd: fix coverity warnings about evpn vpn variable
A few paths could see a vpn variable with a NULL value;
check and protect those paths.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2023-12-27 18:01:36 -08:00
Chirag Shah
fa00a2f765 bgpd: revamp evpn debugs nexthop and l3vni
Add nexthop fied when import/unimport evpn route in vrf,
print bgp vrf instance name which contains "VRF" keyword.

Include pathcount which is list of paths linked to nexthop.

add and delete l3vni to keep symmetric "L3VNI" keyword as
used in other debug statements.

Ticket: #3671288
Testing Done:

2023/12/27 05:10:03.339616 BGP: [HPE1G-3H7F2] ... new pi VRF vrf2
dest 0x55663e8372c0 (l 2) pi 0x55663e8374d0 (l 1, f 0x4010) nh 6.0.0.1

2023/12/27 05:58:56.650116 BGP: [MC0JJ-7ZYQB] ... delete pi VRF vrf2
dest 0x55663e885110 (l 5) pi 0x55663e8851e0 (l 1, f 0x4098) nh 6.0.0.1

2023/12/27 05:10:03.339581 BGP: [P4TBX-3W31N] evpn VRF vrf2 nh
6.0.0.1 rmac 00:02:00:00:00:04 add to zebra

2023/12/27 06:13:12.685906 BGP: [SWSCZ-2Z6M4] evpn vrf VRF vrf1 nh
6.0.0.1 del to zebra

2023/12/27 05:10:03.339603 BGP: [Y2EAK-4N7FV] path 60.1.1.111/32 linked
to VRF vrf2 nh 6.0.0.1 pathcount 0

2023/12/27 05:58:56.650125 BGP: [GVE17-CSNTB] path 81.1.1.0/24 unlinked
from VRF vrf2 nh 6.0.0.1 pathcount 16

2023/12/27 05:08:10.108038 ZEBRA: [Q8ZEK-CT776] Send L3VNI ADD 104001
VRF vrf1 RMAC 00:04:ba:10:10:62 VRR 1c:34:da:19:59:62 local-ip 6.0.0.31
filter none to bgp

2023/12/27 05:08:26.043121 ZEBRA: [R43YF-2MKZ3] Send L3VNI DEL 104001
VRF vrf1 to bgp

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-12-27 16:13:13 -08:00
Christian Hopps
80cac370d0 lib: yang: add tree "printing" utility functions
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-26 08:34:56 -05:00
Christian Hopps
8790457c46 lib: add simplified native msg support
This is intended to replace protobuf use in mgmtd.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-26 08:34:56 -05:00
Quentin Young
080299fe10
Merge pull request #15063 from idryzhov/dev-doc-graphviz
doc: add graphiz dependency for dev docs
2023-12-23 22:50:23 -05:00
Igor Ryzhov
c3c5431da2
Merge pull request #15053 from opensourcerouting/fix/drop_ipv6_address_configured
zebra: Drop ipv6_address_configured() function
2023-12-22 22:13:32 +02:00
Igor Ryzhov
4907ce966b doc: add graphiz dependency for dev docs
There's a graph in cli.rst that needs graphviz to be built.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-12-22 16:08:43 +02:00
Donatas Abraitis
c733a38d84 github: Mark the build as failed if 'do not merge' label is set
This prevents us from merging PRs marked as 'do not merge'.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-22 10:29:52 +02:00
Konstantin Shalygin
47bce1762b
redhat: rpm spec: added protobuf-c to deps & fix bogus changelog date
Fixes for:
```
checking for protoc-c... no
configure: error: in `/builddir/build/BUILD/frr-frr-9.1':
configure: error: protobuf requested but protoc-c not found.  Install protobuf-c.
```

And rpmlint warnings:
```
warning: line 208: It's not recommended to have unversioned Obsoletes: Obsoletes:          gated mrt zebra frr-sysvinit
warning: bogus date in %changelog: Thu Oct 09 2023 Donatas Abraitis <donatas@opensourcerouting.org> - 9.1
    line 208: It's not recommended to have unversioned Obsoletes: Obsoletes:          gated mrt zebra frr-sysvinit
    bogus date in %changelog: Thu Oct 09 2023 Donatas Abraitis <donatas@opensourcerouting.org> - 9.1
```

Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
2023-12-22 11:03:41 +03:00
Donatas Abraitis
eba1c1e23b
Merge pull request #15059 from donaldsharp/generate_support_bundle_on_test_failure
Generate support bundle on test failure
2023-12-22 09:32:32 +02:00
Donatas Abraitis
1225954fb6
Merge pull request #15060 from donaldsharp/keychain_free_no_i_really_mean_it
lib: Keychain.c was using free
2023-12-22 09:31:21 +02:00
Donald Sharp
09fbf2e56d lib: Keychain.c was using free
This is a bit of a bummer that this slipped through
for so long.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 17:01:56 -05:00
Donatas Abraitis
cb777f9576 zebra: Show IPv6 link-local interfaces under show interface brief output
Despite if it's managed by FRR or the kernel, show it. If the system has only
link-local addresses, we should show it unless it's a secondary one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-21 22:57:11 +02:00
Donald Sharp
daa80a5afa tools: Add some more data to support bundles
The ipv[4|6] vpn tables in bgp were not being
gathered.  This would be useful for some situations

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 10:26:47 -05:00
Donald Sharp
1aa6c5ec23 tests: Stop some warning messages on test runs
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 10:24:23 -05:00
Donald Sharp
7477d8732f tests: Auto generate support bundle when a test fails
Tests can fail, let's be proactive and gather up a support
bundle when they fail.  It will help diagnose the problem
to some extent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-21 10:22:22 -05:00
Donatas Abraitis
f95479b150 zebra: Show IPv6 link-local interfaces under show interface output
Despite if it's managed by FRR or the kernel, show it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-21 16:32:15 +02:00
Donatas Abraitis
02f8cf7769 zebra: Push all configured IP addresses when the interface comes up
Let's say we this:

```
$ ip link set down dev r1-eth0
$ ip link set up dev r1-eth0
```

But at the same time we have this interface configured by the FRR too:

```
interface r1-eth0
 ipv6 address fe80:1::1/64
exit
```

We never re-add fe80:1::1/64, when the interface comes up, and we have a
strange situation where NHT stops working and other stuff depending on NHT
stops too (BGP peering, etc.).

Closes: https://github.com/FRRouting/frr/issues/15050

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-21 16:32:14 +02:00
Donatas Abraitis
1332be595e zebra: Drop ipv6_address_configured() function
Not used.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-21 15:25:27 +02:00
Russ White
bbda45a825
Merge pull request #15047 from LabNConsulting/aceelindem/fix-opaque-functab-leak
ospfd: Fix opaque functab memory leak and opaque AS External LSA cleanup problems
2023-12-20 15:42:25 -05:00
Acee
dec87faab6 ospfd: Fix opaque functab leak and opaque AS cleanup problems
1. Fix ospf opaque LSA function table memory leak.
   2. Remove incorrect one-to-one association of OSPF info-per-type
      to function table (since there many be many).
   3. Fix a problem with opaque AS external cleanup that was exposed
      by #2.
   4. Fix LSA memory leak in ospf_opaque_type9_lsa_if_cleanup().

Signed-off-by: Acee <aceelindem@gmail.com>
2023-12-20 09:43:51 -05:00
Russ White
b6cb72fccd
Merge pull request #15046 from FRRouting/revert-15002-bgp_evpn_label_no_delete
Revert "bgpd: When receiving a label, store it"
2023-12-19 11:42:04 -05:00
Donald Sharp
d1b3f070b1
Revert "bgpd: When receiving a label, store it" 2023-12-19 11:40:24 -05:00
Russ White
a3388fa6b1
Merge pull request #15002 from donaldsharp/bgp_evpn_label_no_delete
bgpd: When receiving a label, store it
2023-12-19 11:34:04 -05:00
Donald Sharp
066f379ffd
Merge pull request #15022 from opensourcerouting/fix/change_to_log.error
tools: Use error log level when failing to execute commands via frr-reload.py
2023-12-18 08:58:09 -05:00
Donald Sharp
490928b6d4
Merge pull request #15036 from opensourcerouting/fix/use_constants_for_addpath_cap_length
bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value
2023-12-18 08:54:39 -05:00
Donald Sharp
b3e5ee5e44
Merge pull request #15037 from opensourcerouting/fix/validate_send_receive_flags
bgpd: Validate Addpath capability flags per AF
2023-12-18 08:54:22 -05:00
Donatas Abraitis
24ecc73274
Merge pull request #15032 from leonshaw/fix/bgp-default-withdraw
bgpd: "default-originate" shouldn't withdraw non-default routes
2023-12-18 12:39:51 +02:00
Philippe Guibert
d8477d4bb5 bgpd, lib: add zapi_route_set_nhg_id() support
There is no function that both sets the nhg id, and sets
the ZAPI_MESSAGE_NHG flag if the nhg id is valid.
Create a ZAPI API to do this, and apply the changes wherever
needed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-18 10:08:45 +01:00
Philippe Guibert
237ebf8d45 bgpd: rework bgp_zebra_announce() function, separate nexthop handling
Separate the processing in bgp_zebra_announce(), by separating the
nexthop code in a separate function called
bgp_zebra_announce_parse_nexthop(). This commit does not bring any
functional change.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-18 10:08:45 +01:00
Philippe Guibert
5d4af03ff8 bgpd: rework debug nexthop in separate function
When adding/removing a route, the next-hop can be dumped
with debugging turned on. Move this function in a separate
function. There is no other change in this commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-12-18 10:08:45 +01:00
Xiao Liang
4538247c99 tests: Check for 0.0.0.0/1 in bgp_default_route
Ensure that 0.0.0.0/1 route can be advertised along with
default-originate.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2023-12-18 15:14:33 +08:00
Donatas Abraitis
0f05e56bed bgpd: Validate Addpath capability flags per AF
Send/Receive:
         This field indicates whether the sender is (a) able to receive
         multiple paths from its peer (value 1), (b) able to send
         multiple paths to its peer (value 2), or (c) both (value 3) for
         the <AFI, SAFI>.

         If any other value is received, then the capability SHOULD be
         treated as not understood and ignored [RFC5492].

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-17 21:25:51 +02:00
Donatas Abraitis
e09b5afb9d
Merge pull request #15035 from donaldsharp/more_frr_memory_leaks_on_shutdown
More frr memory leaks on shutdown
2023-12-17 12:04:47 +02:00
Donatas Abraitis
66c78c6c58 bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-17 12:03:36 +02:00
Donald Sharp
e700069534 nhrpd: Cleanup a hash on nhrp shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-16 09:29:00 -05:00
Donald Sharp
f38687b8f5 lib, bgpd, nhrpd: Cleanup memory in lib/resolver on shutdown
This memory was not being cleaned up on shutdown.  Fix this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-12-16 09:18:41 -05:00
Xiao Liang
4d74ba929d bgpd: "default-originate" shouldn't withdraw non-default routes
Prevent "default-originate" from withdrawing non-default routes like
0.0.0.0/1 by checking prefix length.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2023-12-15 18:27:39 +08:00