summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15136 from idryzhov/ignore-cbsDonatas Abraitis2024-01-125-27/+28
|\ | | | | lib, mgmtd: rename ignore_cbs to ignore_cfg_cbs
| * lib, mgmtd: rename ignore_cbs to ignore_cfg_cbsIgor Ryzhov2024-01-115-27/+28
| | | | | | | | | | | | | | | | Setting this variable to true makes NB ignore only configuration-related callbacks. CLI-related callbacks are still loaded and executed, so rename the variable to make it clearer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #15127 from opensourcerouting/fix/doc_libyang_artifactsChristian Hopps2024-01-121-3/+2
|\ \ | | | | | | doc: libyang nits
| * | doc: Fix documentation warning on the required version of libyangDonatas Abraitis2024-01-111-2/+1
| | | | | | | | | | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * | doc: Change the link to libyang for 2.1.xDonatas Abraitis2024-01-111-1/+1
| | | | | | | | | | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | | Merge pull request #15134 from idryzhov/fix-commit-clientsChristian Hopps2024-01-121-8/+8
|\ \ \ | | | | | | | | mgmtd: don't try to send config to disconnected clients
| * | | mgmtd: don't try to send config to disconnected clientsIgor Ryzhov2024-01-111-8/+8
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | When determining the interested backend clients for a configuration change, don't consider disconnected clients. This fixes a crash in `mgmt_txn_send_be_txn_create` when trying to send data to a non-existing adapter. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | | Merge pull request #15131 from LabNConsulting/chopps/oper-choice-caseIgor Ryzhov2024-01-114-66/+151
|\ \ \ | |/ / |/| | Chopps/oper choice case
| * | lib: change type of `inner` to `struct lyd_node *`, cleaner codeChristian Hopps2024-01-111-31/+40
| | | | | | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
| * | lib: implement missing YANG choice/case statements.Christian Hopps2024-01-114-41/+117
| | | | | | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | | Merge pull request #15128 from ↵Donald Sharp2024-01-117-20/+99
|\ \ \ | |/ / |/| | | | | | | | opensourcerouting/fix/bgp_oad_ECOMMUNITY_ORIGIN_VALIDATION_STATE bgpd: Recent EBGP-OAD improvements
| * | bgpd: Allow sending Origin Validation State extended community over EBGP-OADDonatas Abraitis2024-01-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://datatracker.ietf.org/doc/html/draft-uttaro-idr-bgp-oad#section-3.13 Extended communities which are non-transitive across an AS boundary MAY be advertised over an EBGP-OAD session if allowed by explicit policy configuration. If allowed, all the members of the OAD SHOULD be configured to use the same criteria. For example, the Origin Validation State Extended Community, defined as non-transitive in [RFC8097], can be advertised to peers in the same OAD. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * | tests: Check if the route over eBGP is preferred when eBGP-OAD is usedDonatas Abraitis2024-01-116-7/+64
| | | | | | | | | | | | | | | | | | | | | If at least one of the candidate routes was received via EBGP, remove from consideration all routes that were received via EBGP-OAD and IBGP. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * | bgpd: Show external session sub-type (OAD) if existsDonatas Abraitis2024-01-111-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` r1# sh ip bgp 10.10.10.10/32 BGP routing table entry for 10.10.10.10/32, version 1 Paths: (2 available, best #2, table default) Advertised to non peer-group peers: 192.168.1.2 192.168.1.4 65002 65003 192.168.1.2 from 192.168.1.2 (192.168.2.2) Origin incomplete, metric 123, localpref 123, valid, external (oad) Last update: Thu Jan 11 10:46:32 2024 65004 65005 192.168.1.4 from 192.168.1.4 (192.168.4.4) Origin incomplete, metric 123, localpref 123, valid, external, best (Peer Type) Last update: Thu Jan 11 10:46:30 2024 r1# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * | bgpd: Prefer routes over eBGP versus eBGP-OADDonatas Abraitis2024-01-111-10/+20
| |/ | | | | | | | | | | | | If at least one of the candidate routes was received via EBGP, remove from consideration all routes that were received via EBGP-OAD and IBGP. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | Merge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2Donatas Abraitis2024-01-1155-18/+84
|\ \ | |/ |/| Lib zebra h cleanup 2
| * lib: limits.h is not needed by zebra.hDonald Sharp2024-01-091-1/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * zebra: Nothing is using errno.hDonald Sharp2024-01-091-1/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: string.h was only used by vector.c make it betterDonald Sharp2024-01-092-1/+1
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: stdbool.h is not being used by zebra.hDonald Sharp2024-01-091-1/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: zebra.h is not using signal.hDonald Sharp2024-01-099-1/+15
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: zebra.h uses pwd.h when it should notDonald Sharp2024-01-093-1/+2
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * *: zebra.h should not have fcntl.hDonald Sharp2024-01-0926-1/+32
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: zebra.h was including compiler.h two timesDonald Sharp2024-01-091-7/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: remove net/route.h it is not usedDonald Sharp2024-01-096-2/+9
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * *: remove sys/stat.h from zebra.hDonald Sharp2024-01-0925-2/+26
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * lib: select.h is not being used by anyoneDonald Sharp2024-01-091-1/+0
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #15124 from fdumontet6WIND/large_fdsDonald Sharp2024-01-111-9/+12
|\ \ | | | | | | lib snmp: use snmp's large fd sets for agentx
| * | lib: use snmp's large fd sets for agentxEdwin Brossette2024-01-101-9/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The maximum number of file descriptors in an fd set is limited by FD_SETSIZE. This limitation is important because the libc macros FD_SET(), FD_CLR() and FD_ISSET() will invoke a sigabort if the size of the fd set given to them is above FD_SETSIZE. We ran into such a sigabort with bgpd because snmp can return an fd set of size higher than FD_SETSIZE when calling snmp_select_info(). An unfortunate FD_ISSET() call later causes the following abort: Received signal 6 at 1701115534 (si_addr 0xb94, PC 0x7ff289a16a7c); aborting... /lib/x86_64-linux-gnu/libfrr.so.0(zlog_backtrace_sigsafe+0xb3) [0x7ff289d62bba] /lib/x86_64-linux-gnu/libfrr.so.0(zlog_signal+0x1b4) [0x7ff289d62a1f] /lib/x86_64-linux-gnu/libfrr.so.0(+0x102860) [0x7ff289da4860] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7ff2899c2520] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c) [0x7ff289a16a7c] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16) [0x7ff2899c2476] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3) [0x7ff2899a87f3] /lib/x86_64-linux-gnu/libc.so.6(+0x896f6) [0x7ff289a096f6] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x2a) [0x7ff289ab676a] /lib/x86_64-linux-gnu/libc.so.6(+0x1350c6) [0x7ff289ab50c6] /lib/x86_64-linux-gnu/libc.so.6(+0x1366ab) [0x7ff289ab66ab] /lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x36f5) [0x7ff2897736f5] /lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x3c27) [0x7ff289773c27] /lib/x86_64-linux-gnu/libfrr.so.0(thread_call+0x1c2) [0x7ff289dbe105] /lib/x86_64-linux-gnu/libfrr.so.0(frr_run+0x257) [0x7ff289d56e69] /usr/bin/bgpd(main+0x4f4) [0x560965c40488] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ff2899a9d90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ff2899a9e40] /usr/bin/bgpd(_start+0x25) [0x560965c3e965] in thread agentx_timeout scheduled from /build/make-pkg/output/_packages/cp-routing/src/lib/agentx.c:122 agentx_events_update() Also, the following error is logged by snmp just before the abort: snmp[err]: Use snmp_sess_select_info2() for processing large file descriptors snmp uses a custom struct netsnmp_large_fd_set to work above the limit imposed by FD_SETSIZE. It is noteworthy that, when calling snmp_select_info() instead of snmp_select_info2(), snmp uses the same code working with its custom, large structs, and copy/paste the result to a regular, libc compatible fd_set. So there should be no downside working with snmp_select_info2() instead of snmp_select_info(). Replace every use of the libc file descriptors sets by snmp's extended file descriptors sets in agentx to acommodate for the high number of file descriptors that can come out of snmp. This should prevent the abort seen above. Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
* | Merge pull request #15100 from donaldsharp/SA_problems_localDonatas Abraitis2024-01-105-11/+11
|\ \ | | | | | | Sa problems local
| * | zebra: SA incorrectly believes a NULL pointerDonald Sharp2024-01-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | SA has decided that old_re could be a NULL pointer even though the zebra_redistribute_check function checks for NULL and returns false that would not allow a NULL pointer deref. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | bgpd: data is set but never usedDonald Sharp2024-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | I've kept the assignment in a comment because I am concerned about new code being added later that the data pointer would not be set correctly. Next coder can see the commented out line and uncomment it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | ospf6d: Value set is never usedDonald Sharp2024-01-091-1/+1
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | pimd: Cleanup SA issue with value never usedDonald Sharp2024-01-091-1/+1
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | bgpd: Clean up issues found in SA with clang 14Donald Sharp2024-01-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3 different issues: a) length never used b) safi never used c) length never used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #15123 from LabNConsulting/chopps/fix-oper-state-memleakDonatas Abraitis2024-01-102-6/+8
|\ \ \ | |/ / |/| | lib: fix oper-state memleak
| * | lib: fix oper-state memleakChristian Hopps2024-01-092-6/+8
| | | | | | | | | | | | | | | | | | Fix memleak when a key-ed query was done for which the key didn't exist. Signed-off-by: Christian Hopps <chopps@labn.net>
* | | Merge pull request #15103 from LabNConsulting/chopps/oper-filterDonald Sharp2024-01-0914-139/+425
|\ \ \ | | | | | | | | Implement full XPath 1.0 functionality
| * | | tests: test new XPath 1.0 predicate functionalityChristian Hopps2024-01-072-3/+19
| | | | | | | | | | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
| * | | lib: use libyang functions if they are presentChristian Hopps2024-01-076-136/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add configure.ac tests for libyang functions, if not present supply the functionality ourselves in yang.[ch] Signed-off-by: Christian Hopps <chopps@labn.net>
| * | | lib: mgmtd: implement full XPath 1.0 predicate functionalityChristian Hopps2024-01-079-22/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow user to specify full YANG compatible XPath 1.0 predicates. This allows for trimming results of generic queries using functions and other non-key predicates from XPath 1.0 Signed-off-by: Christian Hopps <chopps@labn.net>
| * | | lib: fix clang SA warningsChristian Hopps2024-01-073-9/+29
| | | | | | | | | | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | | | Merge pull request #15122 from opensourcerouting/fix/drop_packet_send_debugsDonald Sharp2024-01-092-5/+4
|\ \ \ \ | | | | | | | | | | bgpd: Change printing format show debugging for debug bgp updates
| * | | | bgpd: Change printing format `show debugging` for `debug bgp updates`Donatas Abraitis2024-01-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` BGP debugging status: BGP updates debugging is on (inbound) for 127.0.0.1 with prefix-list rn-dummy 192.168.10.18 with prefix-list rn-dummy 1.1.1.1 ``` After: ``` BGP debugging status: BGP updates debugging is on (inbound) for: 127.0.0.1 with prefix-list rn-dummy 192.168.10.18 with prefix-list rn-dummy 192.168.10.20 ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * | | | bgpd: Drop BGP_DEBUG_PACKET_SEND_DETAIL/BGP_DEBUG_PACKET_SEND constsDonatas Abraitis2024-01-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not used anywhere. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | | | | Merge pull request #15108 from opensourcerouting/fix/debug_bgp_updates_detailRuss White2024-01-094-3/+40
|\ \ \ \ \ | | | | | | | | | | | | bgpd: Add `debug bgp updates detail` command
| * | | | | bgpd: Add `debug bgp updates detail` commandDonatas Abraitis2024-01-074-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When filtering with `debug bgp updates in x.x.x.x prefix-list plist`, we want to filter out unnecessary messages like: ``` 127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5 ``` Such a line as above will be repeated for all the paths received and it's useless without knowing the prefix (because NLRIs are not parsed yet). But want to see only relevant ones: ``` 127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002 127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast ``` With `debug bgp updates detail` we can combine this to something like: ``` 127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002 127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5 127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | | | | | Merge pull request #15001 from pguibert6WIND/zebra_nexthop_reworkRuss White2024-01-093-164/+190
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | Zebra nexthop rework
| * | | | | bgpd, lib: add zapi_route_set_nhg_id() supportPhilippe Guibert2023-12-183-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | | bgpd: rework bgp_zebra_announce() function, separate nexthop handlingPhilippe Guibert2023-12-181-164/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>