Commit Graph

34178 Commits

Author SHA1 Message Date
Donald Sharp
1b1fc14ffc lib: Remove in_systm.h it is never used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:32:32 -05:00
Donald Sharp
75b3e82dfa *: Remove cost of including netinet/icmp.h everywhere
This file inclusion is only used in 3 places move
the includes to those spots.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:26:33 -05:00
Donald Sharp
ca54540576 lib: Remove inclusion of various MAXINT from zebra.h
All modern systems should have these defined.  Let's stop
paying the cost of this compilation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:24:01 -05:00
Donald Sharp
fbc31156f0 lib: HAVE_GLIBC_BACKTRACE does not belong in zebra.h
The backtrace functionality has been abstracted over
to zlog_backtrace().  Now that every place uses this
move the inclusion for HAVE_GLIBC_BACKTRACE into
the appropriate files instead of having everyone
pay for this costly include.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:20:40 -05:00
Donald Sharp
a57379fa14 bgpd: rfapi was not using internal zlog_backtrace()
The rfapi code was not using the zlog_backtrace()
functionality.  Let's just convert over to using
the proper functionality that we have built in now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:18:16 -05:00
Donald Sharp
78690deaf2 lib: Move some priviledge headers to file they are used.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:04:36 -05:00
Donald Sharp
2bf051a577 *: Remove Crypto openSSL define from zebra.h
Only a couple of places use this.  Move these to a better
spot.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:02:34 -05:00
Donald Sharp
10387101fe lib: Breakout sendmmsg into it's own header
The only 2 places sendmmsg is used is in zlog_5424.c
and zlog_live.c.  Why is the rest of the entire system
paying for this compilation?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 13:56:09 -05:00
Donald Sharp
4e249eb2e4
Merge pull request #15083 from louis-6wind/fix-isis_spftree_del
isisd: fix _isis_spftree_del heap-use-after-free
2024-01-04 13:01:21 -05:00
Louis Scalbert
9fa9a9d865 isisd: fix _isis_spftree_del heap-use-after-free
Fix the following heap-use-after-free

> ==82961==ERROR: AddressSanitizer: heap-use-after-free on address 0x6020001e4750 at pc 0x55a8cc7f63ac bp 0x7ffd6948e340 sp 0x7ffd6948e330
> READ of size 8 at 0x6020001e4750 thread T0
>     #0 0x55a8cc7f63ab in isis_route_node_cleanup isisd/isis_route.c:335
>     #1 0x7ff25ec617c1 in route_node_free lib/table.c:75
>     #2 0x7ff25ec619fc in route_table_free lib/table.c:111
>     #3 0x7ff25ec61661 in route_table_finish lib/table.c:46
>     #4 0x55a8cc800d83 in _isis_spftree_del isisd/isis_spf.c:397
>     #5 0x55a8cc800e45 in isis_spftree_clear isisd/isis_spf.c:414
>     #6 0x55a8cc80bd9a in isis_run_spf isisd/isis_spf.c:2020
>     #7 0x55a8cc80c370 in isis_run_spf_with_protection isisd/isis_spf.c:2076
>     #8 0x55a8cc80cf52 in isis_run_spf_cb isisd/isis_spf.c:2165
>     #9 0x7ff25ec7c4dc in event_call lib/event.c:1970
>     #10 0x7ff25eb64423 in frr_run lib/libfrr.c:1213
>     #11 0x55a8cc7799da in main isisd/isis_main.c:318
>     #12 0x7ff25e623d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>     #13 0x7ff25e623e3f in __libc_start_main_impl ../csu/libc-start.c:392
>     #14 0x55a8cc778e44 in _start (/usr/lib/frr/isisd+0x109e44)
>
> 0x6020001e4750 is located 0 bytes inside of 16-byte region [0x6020001e4750,0x6020001e4760)
> freed by thread T0 here:
>     #0 0x7ff25f000537 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
>     #1 0x7ff25eb9012e in qfree lib/memory.c:130
>     #2 0x55a8cc7f6485 in isis_route_table_info_free isisd/isis_route.c:351
>     #3 0x55a8cc800cf4 in _isis_spftree_del isisd/isis_spf.c:395
>     #4 0x55a8cc800e45 in isis_spftree_clear isisd/isis_spf.c:414
>     #5 0x55a8cc80bd9a in isis_run_spf isisd/isis_spf.c:2020
>     #6 0x55a8cc80c370 in isis_run_spf_with_protection isisd/isis_spf.c:2076
>     #7 0x55a8cc80cf52 in isis_run_spf_cb isisd/isis_spf.c:2165
>     #8 0x7ff25ec7c4dc in event_call lib/event.c:1970
>     #9 0x7ff25eb64423 in frr_run lib/libfrr.c:1213
>     #10 0x55a8cc7799da in main isisd/isis_main.c:318
>     #11 0x7ff25e623d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>
> previously allocated by thread T0 here:
>     #0 0x7ff25f000a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>     #1 0x7ff25eb8ffdc in qcalloc lib/memory.c:105
>     #2 0x55a8cc7f63eb in isis_route_table_info_alloc isisd/isis_route.c:343
>     #3 0x55a8cc80052a in _isis_spftree_init isisd/isis_spf.c:334
>     #4 0x55a8cc800e51 in isis_spftree_clear isisd/isis_spf.c:415
>     #5 0x55a8cc80bd9a in isis_run_spf isisd/isis_spf.c:2020
>     #6 0x55a8cc80c370 in isis_run_spf_with_protection isisd/isis_spf.c:2076
>     #7 0x55a8cc80cf52 in isis_run_spf_cb isisd/isis_spf.c:2165
>     #8 0x7ff25ec7c4dc in event_call lib/event.c:1970
>     #9 0x7ff25eb64423 in frr_run lib/libfrr.c:1213
>     #10 0x55a8cc7799da in main isisd/isis_main.c:318
>     #11 0x7ff25e623d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Fixes: 7153c3cabf ("isisd: update struct isis_route_info has multiple sr info by algorithm")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-03 16:23:50 +01:00
Russ White
2aef6958f8
Merge pull request #15074 from chiragshah6/fdev4
bgpd: unimport evpn routes when implicit withdraw
2024-01-02 17:22:11 -05:00
Russ White
2e69afd9da
Merge pull request #15055 from opensourcerouting/fix/zebra_ipv6_ll_configured
zebra: Push all configured IP addresses when the interface comes up
2024-01-02 10:42:08 -05:00
Donald Sharp
077fc27c4a
Merge pull request #15062 from opensourcerouting/fix/mark_as_failed_if_do_not_merge_labeled
github: Mark the build as failed if 'do not merge' label is set
2024-01-02 10:38:34 -05:00
Russ White
54c2d327d3
Merge pull request #12261 from cscarpitta/srv6-encap-src-addr
zebra: Add the support of the Source Addr param of the SRv6 Encapsulation
2024-01-02 10:37:34 -05:00
Donald Sharp
de01b61b32
Merge pull request #15070 from LabNConsulting/chopps/fix-coverity-errors
chopps/fix coverity errors
2024-01-02 10:09:03 -05:00
Donald Sharp
da7668ff90
Merge pull request #15071 from LabNConsulting/chopps/building-cleanup
build: protobuf is required so update building docs
2024-01-02 10:07:10 -05:00
Donald Sharp
60f099657f
Merge pull request #15073 from LabNConsulting/chopps/fix-yang-key-queries
lib: fix specific entry queries
2024-01-02 10:06:22 -05:00
Donald Sharp
f6ae11819c
Merge pull request #15076 from LabNConsulting/chopps/libyang-no-schema-node-key-guarantee
lib: don't count on scheme key nodes being first children
2024-01-02 10:05:16 -05:00
Donald Sharp
0fb3dda62b
Merge pull request #15075 from pguibert6WIND/pathd_metric_computed
pathd: add dynamic candidate path metric [computed] keyword
2024-01-02 10:04:40 -05:00
Christian Hopps
412eec1bed
lib: don't count on scheme key nodes being first children
Heard back from libyang folks that this is not something they consider part of
the API and/or are going to guarantee. So we cannot count on it. Expect keys at
any location on the child sibling list.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-02 11:34:34 +00:00
Philippe Guibert
784c93cc62 pathd: add dynamic candidate path metric [computed] keyword
Add the 'computed' keyword for a given metric.

> [..]
> metric te computed

When set by the PCC, the PCE must send back a computed metric
value in the PCResponse value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-01-02 12:07:49 +01:00
Christian Hopps
7e6595698b
lib: fix specific entry queries
- fix key leaf queries
- fix specific list entry with non-key leaf top element

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-02 09:47:15 +00:00
Donatas Abraitis
bfe52f8929
Merge pull request #15068 from chiragshah6/zdev
bgpd: lttng tp add ethtag to macip zebra send
2024-01-02 10:42:28 +02:00
Donatas Abraitis
e684b4236b
Merge pull request #15066 from chiragshah6/mdev1
bgpd: revamp evpn debugs nexthop and l3vni
2024-01-02 10:40:14 +02:00
Chirag Shah
d8689cc630 bgpd: unimport evpn routes when implicit withdraw
When bgp update is received for EVPN prefix
where for an existing path's nexthop becomes unreachable,
the path is marked as not VALID but the routes
were not unimported from tenant vrfs, which lead to
stale unicast route(s) and nexthop(s).

In Multipath scenario only a specific path may have marked as
not VALID, then specific path info for the EVPN prefix required to be
unimported from tenant vrf.

Ticket: #3671288

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-01 21:34:22 -08:00
Christian Hopps
c00002d0d0 build: protobuf is required so update building docs
- recommend using libyang 2.1.128 but accept 2.0.0 for now.
- update ubuntu building doc to add GRPC section
- update ubuntu reference docker builds to match grpc doc change

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-31 13:51:21 +00:00
Christian Hopps
39e0f331d2 lib: mgmtd: increase soft-max msg size to 64K
- remove unused mgmt client/server constants

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Christian Hopps
1a7b50a00a lib: fix coverity CID 1574981
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Christian Hopps
30e63f2900 mgmtd: fix coverity CID 1574980
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Christian Hopps
b28cd405c8 lib: fix coverity CID 1574979
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Christian Hopps
913892e2ad mgmtd: fix coverity CID 1574978
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Christian Hopps
db11968a3d lib: fix coverity CID 1574977
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-30 16:03:45 +00:00
Igor Ryzhov
353ee7bb81
Merge pull request #14492 from LabNConsulting/oper-state
oper state
2023-12-29 07:08:30 +02:00
Christian Hopps
f7258386db tests: add mgmt_oper topotest
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:37:18 +00:00
Christian Hopps
2bb115fd78 tests: client testing
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:17:24 +00:00
Christian Hopps
b8b5290105 lib: fixes required after rebasing
lib: fix checkpatch warnings
lib: darr: disable check
mgmtd: fix initialization

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:17:24 +00:00
Christian Hopps
d0f71a90da zebra: fix cleanup of mgmt backend state
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 18:17:24 +00:00
Christian Hopps
c521d45b37 zebra: fix oper-state walk bug
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:53:40 +00:00
Christian Hopps
d266b1cc9c zebra: support yielding between oper state routes query
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:53:40 +00:00
Christian Hopps
ef91d34f01 zebra: add zebra to mgmtd oper-state
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:53:40 +00:00
Christian Hopps
4e0147a05e lib: add dedicated API functions for native msgs
- reorg native message header

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:53:40 +00:00
Christian Hopps
ad1ccb6e62 lib: northbound: add yielding and batching to oper-state queries
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
b7db6b2675 lib: darr: add ability to set MTYPE for dynamic arrays
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
356c01b121 lib: yang: add yang_get_node_keys() function
- comment out unused mem-leaking function.
- improve yang_dnode_get_path return type

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
Christian Hopps
60a8cf71f7 tools: add more libyang iter macros to .clang-format
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28 17:52:57 +00:00
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