summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-04-03Merge pull request #18569 from FRRouting/mergify/bp/stable/10.3/pr-18494Donatas Abraitis
lib: Return duplicate prefix-list entry test (backport #18494)
2025-04-03lib: Return duplicate prefix-list entry testDonatas Abraitis
If we do e.g.: ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 We end up, having duplicate records with a different sequence number only. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 8384d41144496019725c1e250abd0ceea854341f)
2025-04-02lib: Return duplicate ipv6 prefix-list entry testDonatas Abraitis
Fixes: 8384d41144496019725c1e250abd0ceea854341f ("lib: Return duplicate prefix-list entry test") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 24ae7cd30a055dc17fc9d75762320e1359e005b2)
2025-03-19lib: Create VRF if neededmergify/bp/stable/10.3/pr-18430Nathan Bahr
When creating a control plane protocol through NB, create the vrf if needed instead of only looking up and asserting if it doesn't exist yet. Fixes 18429. Signed-off-by: Nathan Bahr <nbahr@atcorp.com> (cherry picked from commit b6ae01f907c071be6cd197df0f3ca6fe9baa631a)
2025-03-03lib: nb: fix bug with oper-state query on list dataChristian Hopps
The capacity of the xpath string was not guaranteed to be sufficient to hold all the key predicates and so would truncate. Calculate the required space and guarantee that it is available. Signed-off-by: Christian Hopps <chopps@labn.net>
2025-03-03lib: nb: fix bug with keyless list specific index lookupChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-22lib: nb: fix oper-state queries that involve choice/case nodesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net> (cherry picked from commit b9ff10b0863a81e95ca72778a2f1230b47ee2fae)
2025-02-18lib: nb: call child destroy CBs when YANG container is deletedChristian Hopps
Previously the code was only calling the child destroy callbacks if the target deleted node was a non-presence container. We now add a flag to the callback structure to instruct northbound to perform the rescursive delete for code that wishes for this to happen. - Fix wrong relative path lookup in keychain destroy callback Signed-off-by: Christian Hopps <chopps@labn.net> (cherry picked from commit d03ecf4562ef3ade6b7b83bf6c683c4741f395ba)
2025-02-13Merge pull request #18146 from FRRouting/mergify/bp/dev/10.3/pr-18023Jafar Al-Gharaibeh
lib: fix false context information for SRv6 route (backport #18023)
2025-02-13lib: Add sidStructure in SRv6 SIDs JSON outputCarmine Scarpitta
The `show ipv6 route json` command displays the IPv6 routing table in JSON format, including SRv6 SIDs. For each SRv6 SID, it provides behavior and SID attributes. However, it does not include the SID structure. This commit adds the SID structure to the SRv6 SID JSON output. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com> (cherry picked from commit 312f7b3f8c7382afef6993aa2110326db2327c35)
2025-02-13lib: fix false context information for SRv6 routePhilippe Guibert
The seg6local route dumped by 'show ipv6 route' makes think that the USP flavor is supported, whereas it is not the case. This information is a context information, and for End, the context information should be empty. > # show ipv6 route > [..] > I>* fc00:0:4::/128 [115/0] is directly connected, sr0, seg6local End USP, weight 1, 00:49:01 Fix this by suppressing the USP information from the output. Fixes: e496b4203055 ("bgpd: prefix-sid srv6 l3vpn service tlv") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> (cherry picked from commit 658bf0281d99461849453628ddc792ec424d0bd4)
2025-02-12Merge pull request #18083 from FRRouting/mergify/bp/dev/10.3/pr-17901Donald Sharp
lib: actually hash all 16 bytes of IPv6 addresses, not just 4 (backport #17901)
2025-02-11lib: crash handlers must be allowed on threadsDavid Lamparter
Blocking all signals on non-main threads is not the way to go, at least the handlers for SIGSEGV, SIGBUS, SIGILL, SIGABRT and SIGFPE need to run so we get backtraces. Otherwise the process just exits. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 13a6ac5b4ca8fc08b348f64de64a787982f24250)
2025-02-11lib: clean up nexthop hashing messDavid Lamparter
We were hashing 4 bytes of the address. Even for IPv6 addresses. Oops. The reason this was done was to try to make it faster, but made a complex maze out of everything. Time for a refactor. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 001fcfa1dd9f7dc2639b4f5c7a52ab59cc425452)
2025-02-11lib: guard against padding garbage in ZAPI readDavid Lamparter
When reading in a nexthop from ZAPI, only set the fields that actually have meaning. While it shouldn't happen to begin with, we can otherwise carry padding garbage into the unused leftover union bytes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 4a0e1419a69d07496c7adfb744beecd00e1efef2)
2025-02-04Merge pull request #17943 from opensourcerouting/clear-event-cpu-uafRuss White
lib: fix use after free in `clear event cpu`
2025-02-04Merge pull request #17336 from forrestchu/sbfdRuss White
implement SBFD
2025-01-31libs: return from change_caps if no capsMark Stapp
When called without caps/privs, just return from "change_caps" instead of exiting - it's possible that a process may not need privs, but a lib (for example) may use the api. Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-01-28Merge pull request #17941 from opensourcerouting/fix-dst-srcRuss White
static: fix botched staticd YANG conversion for dst-src
2025-01-28lib: fix use after free in `clear event cpu`David Lamparter
Freeing any item here means freeing someone's `event->hist`, leaving a dangling pointer there. Which will immediately be written to because we're executing in a CLI function under the `vty_read` event, whose `event->hist` is then updated. Deallocating `event->hist` anywhere other than shutting down the whole event loop is a bad idea to begin with, just zero out the stats instead. Fixes: FRRouting/frr#16419 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-01-28lib, zebra: carry source prefix in route_notifyDavid Lamparter
When a daemon wants to know about its routes, make it possible to have that work for dst-src routes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-01-28staticd: fix botched staticd YANG for dst-srcDavid Lamparter
The staticd YANG conversion completely f*cked up dst-src routes. Stupidly enough, the correct thing is much simpler as seen by the amount of deletes in this commit. This does, unfortunately, involve a rather annoying YANG edge case with what should reasonably be an optional leaf as part of a list key, which is not possible. It uses `::/0` as unconditional filler instead, since that is semantically correct. The `test_yang_mgmt` topotest needed to be adjusted after this to add `src-prefix='::/0'`. Fixes: 88fa5104a04a ("staticd : Configuration northbound implementation") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-01-23bgpd,lib: document the table id / instance usageRafael Zalamena
Document where relevant about the instance overload to table ID so users know what to expect. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-01-23lib,zebra: VRF table-direct supportRafael Zalamena
Implement the necessary data structures and code changes to support sending table-direct routes to protocols running in different VRFs. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-01-23lib: abstract instance redistribution managementRafael Zalamena
Use the linked list `del` callback to free memory instead of manually calling. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-01-23bfdd: Fix CI build issue on kernel with no IPV6_HDRINCLwumu.zsl
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23bfdd: add bfdname info when notify bfd status to PTMwumu.zsl
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-22bfdd: add bfdname in bfd_keywumu.zsl
sbfd will use bfdname for key hash, We introduced a bfd-name for every sbfd session, normal BFD sessions can leave it as NULL. A unique bfd-name can be used to identify a sbfd session quickly. This is quite useful in our Srv6 deployment for path protection case. For example, if use the sbfd session to protect the SRv6 path A-B-D, we would assign the name 'path-a-b-d' or 'a-b-d' to the session. Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-21lib: fix coverity use after free issue: CID 1620101Christian Hopps
The code doesn't push more than one group (currently) so wouldn't hit the bug yet, nice catch by coverity. Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-20Merge pull request #16894 from wenwang00/project-phoenixwing-ysjPhilippe Guibert
staticd: Add support for SRv6 Static SIDs
2025-01-18lib: fix dnode_create to use correct libyang function.Christian Hopps
The previous use of `lyd_new_path()` returns the first node created, rather than the xpath target node. The code is lucky in the sense that it is normally only creating a single node rather than a branch. Fix this to use `lyd_new_path2()` which returns the target node to actually implement the semantics expected by callers of `dnode_create()` (i.e., returning the newly created target node). Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-18lib: improve error handling for datastore notificationsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-18lib: mgmt_be_client handles datastore notification using CBsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-18lib: yang: add yang_parse_data functionChristian Hopps
This is similar to notify and RPC parsers, but this is for normal datastore data. This is initially used in handling datastore notifications being sent to another backend client[s]. Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-18lib: Add CLI node for SRv6 static SIDsYuqing Zhao
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-18lib, isisd: Move DEFAULT_SRV6_IFNAME to global srv6.h headerYuqing Zhao
This commit moves DEFAULT_SRV6_IFNAME from isis_srv6.h to srv6.h because there are other daemons that might want to use it (e.g. staticd). Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-18lib: Add a function to print SRv6 Endpoint Behavior CodepointsYuqing Zhao
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-17Merge pull request #17836 from pguibert6WIND/limit_comm_list_countDonatas Abraitis
limit community list count
2025-01-15lib: introduce global -w option for VRF netns backendIgor Ryzhov
Current -n option is only for zebra and mgmtd. All other daemons receive the VRF backend configuration from zebra upon connection to it. This leads to a potential race condition - daemons need to know the backend before they start reading their config, but they can be not connected to zebra yet at this point. As the VRF backend cannot change during runtime, let's introduce a new global -w option for setting netns backend, to make sure that all daemons know their VRF backend immediately after start. The reason for introducing a new option instead of making -n global is that ospfd already uses -n for another purposes. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15lib, zebra: move ns context intialization to zebraIgor Ryzhov
vrf->ns_ctxt is only ever used in zebra, so move its initialization to zebra's callback. Ideally this pointer shouldn't even be a part of library's vrf struct, and moved to zebra-specific struct, but this is the first step. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-15lib: remove VRF_BACKEND_UNKNOWNIgor Ryzhov
The backend type cannot be unknown. It is configured to VRF_LITE by default in zebra anyway, so just init to VRF_LITE in the lib and remove the UNKNOWN type. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-14lib: northbound/mgmtd: add backend model supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-14Merge pull request #17796 from LabNConsulting/chopps/datastore-notificationsDonald Sharp
operational-state (datastore) change notifications
2025-01-14bgpd: add 'match community-count' command to restrict comm countPhilippe Guibert
Add a mechanism in route-map to filter out route-map which have a list of communities greater than the given number. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-13lib: fix new (incorrect) CLANG SA warningsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13mgmtd: add notify selectors to filter datastore notificationsChristian Hopps
- Additionally push the selectors down to the backends Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13lib: notify on datastore (oper-state) changesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13lib: if: track oper-state inlineChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13lib: vrf: track oper-state inlineChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13lib: northbound: add basic oper-state update functionsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>