]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
13 months agoeigrpd: Drop unused files
Donatas Abraitis [Thu, 21 Mar 2024 14:46:47 +0000 (16:46 +0200)]
eigrpd: Drop unused files

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15574 from chiragshah6/fdev2
Donatas Abraitis [Wed, 20 Mar 2024 21:07:22 +0000 (23:07 +0200)]
Merge pull request #15574 from chiragshah6/fdev2

bgpd: do not del peer upon pg remote as change

13 months agoMerge pull request #15584 from opensourcerouting/fix/remove_periodic_merge_check
Donald Sharp [Wed, 20 Mar 2024 19:03:05 +0000 (15:03 -0400)]
Merge pull request #15584 from opensourcerouting/fix/remove_periodic_merge_check

bgpd: Drop periodic merge check functions

13 months agobgpd: Drop periodic merge check functions 15584/head
Donatas Abraitis [Wed, 20 Mar 2024 14:44:13 +0000 (16:44 +0200)]
bgpd: Drop periodic merge check functions

Not used anymore. There is triggered merge check, not periodic.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15580 from LabNConsulting/chopps/clang-format-comment
Donatas Abraitis [Wed, 20 Mar 2024 06:07:58 +0000 (08:07 +0200)]
Merge pull request #15580 from LabNConsulting/chopps/clang-format-comment

tools: add comment about checking frrbot

13 months agotools: add comment about checking frrbot 15580/head
Christian Hopps [Wed, 20 Mar 2024 00:04:19 +0000 (20:04 -0400)]
tools: add comment about checking frrbot

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #15565 from LabNConsulting/chopps/code-cover
Russ White [Tue, 19 Mar 2024 21:19:45 +0000 (17:19 -0400)]
Merge pull request #15565 from LabNConsulting/chopps/code-cover

tests: enable code coverage reporting with topotests

13 months agoMerge pull request #15558 from opensourcerouting/fix/bgp_dynamic_neighbors_default_ad...
Russ White [Tue, 19 Mar 2024 14:25:29 +0000 (10:25 -0400)]
Merge pull request #15558 from opensourcerouting/fix/bgp_dynamic_neighbors_default_advertise

bgpd: Update default-originate route-map actual map structure

13 months agoMerge pull request #15555 from LabNConsulting/acee/ospf-ls-request-direct-response
Russ White [Tue, 19 Mar 2024 14:24:39 +0000 (10:24 -0400)]
Merge pull request #15555 from LabNConsulting/acee/ospf-ls-request-direct-response

ospfd: Send LS Updates in response to LS Request as unicast.

13 months agoMerge pull request #15552 from sri-mohan1/srib-24-zebra-a
Russ White [Tue, 19 Mar 2024 14:24:13 +0000 (10:24 -0400)]
Merge pull request #15552 from sri-mohan1/srib-24-zebra-a

zebra: changes for code maintainability

13 months agoMerge pull request #15533 from opensourcerouting/fix/add_paths_limit_capability_test
Russ White [Tue, 19 Mar 2024 14:18:44 +0000 (10:18 -0400)]
Merge pull request #15533 from opensourcerouting/fix/add_paths_limit_capability_test

bgpd: Add tests for Paths-Limit capability

13 months agobgpd: do not del peer upon pg remote as change 15574/head
Chirag Shah [Sat, 16 Mar 2024 01:18:42 +0000 (18:18 -0700)]
bgpd: do not del peer upon pg remote as change

Currently, when peer-group remote-as is removed, it
deletes all associated neighbors.
Upon re configuring peer-group remote-as, all neighbors
needs to be reconfigured.

Instead, when peer-group remote-as is remove,
cease associated peer's connection and keep in Idle state.
When the peer-group remote-as is (re)configured, trigger
BGP Peer FSM to form neighbor.
Note the connection will be initiated after start timer
expiry.

Ticket: #3828243
Testing:

----- Peers start config ----

router bgp 65566
 bgp router-id 27.0.0.5
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor fabric remote-as external >>>>
 neighbor swp1 interface peer-group fabric
 neighbor swp1 advertisement-interval 0
 neighbor swp1 timers 3 9
 neighbor swp1 timers connect 10
 neighbor swp2 interface peer-group fabric
 neighbor swp2 advertisement-interval 0
 neighbor swp2 timers 3 9

tor(config)# router bgp 65566
tor(config-router)# no neighbor fabric remote-as external

----- Peers are retained in config ----
router bgp 65566
 bgp router-id 27.0.0.5
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor swp1 interface peer-group fabric
 neighbor swp1 advertisement-interval 0
 neighbor swp1 timers 3 9
 neighbor swp1 timers connect 10
 neighbor swp2 interface peer-group fabric
 neighbor swp2 advertisement-interval 0
 neighbor swp2 timers 3 9

----- Peers are in idle state ----
Neighbor        V  AS  MsgRcvd MsgSent TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
spine-1(swp1)   4   0       52      34      0    0    0 00:00:04         Idle        0 N/A
spine-3(swp2)   4   0       52      34      0    0    0 00:00:04         Idle        0 N/A

tor(config)# router bgp 65566
tor(config-router)# neighbor fabric remote-as external

---- after connect timer expiry forms the neighbor ----

Neighbor       V    AS MsgRcvd MsgSent TblVer InQ OutQ  Up/Down State/PfxRcd  PfxSnt Desc
spine-1(swp1)  4 64435     784     749      0   0    0 00:35:10           11       2 N/A
spine-3(swp2)  4 64435     784     749      0   0    0 00:35:10           11       2 N/A

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agoMerge pull request #15520 from donaldsharp/bgp_dest_dev_build
Donatas Abraitis [Mon, 18 Mar 2024 20:49:27 +0000 (22:49 +0200)]
Merge pull request #15520 from donaldsharp/bgp_dest_dev_build

bgpd: When using dev build add pointer information to %pBD

13 months agoospfd: Send LS Updates in response to LS Request as unicast. 15555/head
Acee Lindem [Thu, 14 Mar 2024 10:05:27 +0000 (10:05 +0000)]
ospfd: Send LS Updates in response to LS Request as unicast.

With this fix, OSPF LS Updates sent in response to OSPF LS Requests during the DB Exchange process will be sent as unicasts. Unless the timing of multiple database exchanges coincides, there is little chance that the LSAs in the LS Update are required by OSPF routers other than the one which elicited the LS Update.

This is somewhat ambigous in RFC 2328 and two errata have been filed for clarification:

https://www.rfc-editor.org/errata/eid7850
https://www.rfc-editor.org/errata/eid7851

FRR OSPFv3 (ospf6d) already does it correctly - see ospf6_lsupdate_send_neighbor(struct event *thread). Also, if there is any doubt, one can refer to the C++ code at ospf.org (John Moy's seminal OSPF reference implementation).

Signed-off-by: Acee Lindem <acee@lindem.com>
13 months agoMerge pull request #15566 from idryzhov/daemonize-nb-logs
Donald Sharp [Mon, 18 Mar 2024 11:59:04 +0000 (07:59 -0400)]
Merge pull request #15566 from idryzhov/daemonize-nb-logs

lib: remove nb/yang memory cleanup when daemonizing

13 months agoMerge pull request #15424 from askorichenko/master
Mark Stapp [Mon, 18 Mar 2024 11:44:14 +0000 (07:44 -0400)]
Merge pull request #15424 from askorichenko/master

zebra: fix route deletion during zebra shutdown

13 months agoMerge pull request #15553 from fdumontet6WIND/as_path_loop
Donatas Abraitis [Mon, 18 Mar 2024 08:54:21 +0000 (10:54 +0200)]
Merge pull request #15553 from fdumontet6WIND/as_path_loop

bgpd: make as-path-loop-detection conform to the framework

13 months agoMerge pull request #15559 from donaldsharp/sig_event_crash_on_crash_problems
Donatas Abraitis [Mon, 18 Mar 2024 06:53:23 +0000 (08:53 +0200)]
Merge pull request #15559 from donaldsharp/sig_event_crash_on_crash_problems

lib: Prevent crash then another crash from happening

13 months agolib: remove nb/yang memory cleanup when daemonizing 15566/head
Igor Ryzhov [Sun, 17 Mar 2024 20:44:28 +0000 (22:44 +0200)]
lib: remove nb/yang memory cleanup when daemonizing

We're not calling any other termination functions to free allocated
memory when daemonizing except these two. There's no reason for such an
exception, and because of these calls we have the following libyang
warnings every time FRR is started:
```
MGMTD: libyang: String "15" not freed from the dictionary, refcount 2
MGMTD: libyang: String "200" not freed from the dictionary, refcount 2
MGMTD: libyang: String "mrib-then-urib" not freed from the dictionary, refcount 2
MGMTD: libyang: String "1000" not freed from the dictionary, refcount 2
MGMTD: libyang: String "10" not freed from the dictionary, refcount 2
MGMTD: libyang: String "5" not freed from the dictionary, refcount 2
```

Remove these calls to get rid of the unnecessary warnings.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agotests: required formatting change 15565/head
Christian Hopps [Sun, 17 Mar 2024 08:57:42 +0000 (04:57 -0400)]
tests: required formatting change

This code wasn't touched by the actual change; however, the formatting fix is
required.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: enable code coverage reporting with topotests
Christian Hopps [Sun, 17 Mar 2024 08:27:31 +0000 (04:27 -0400)]
tests: enable code coverage reporting with topotests

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agolib: Prevent crash then another crash from happening 15559/head
Donald Sharp [Fri, 15 Mar 2024 16:10:58 +0000 (12:10 -0400)]
lib: Prevent crash then another crash from happening

When a memory operation (malloc/free/... ) causes a crash
and the call to core_handler causes another crash then
instead of actually writing a core dump the alarm is
hit and the daemon in trouble will not cause a core dump.
Modify the shutdown code to just try to dump the buffers
and leave instead of cleaning up after itself.

Back Trace:

(gdb) bt
0  0x00007f17082ec056 in __lll_lock_wait_private () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f17082fc8bd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f17082fee8f in free () from /lib/x86_64-linux-gnu/libc.so.6
3  0x00007f170866c2ea in qfree (mt=<optimized out>, ptr=<optimized out>) at lib/memory.c:141
4  0x00007f17086c156a in zlog_tls_free (arg=0x55584f816fb0) at lib/zlog.c:390
5  zlog_tls_buffer_fini () at lib/zlog.c:346
6  0x00007f1708695e5f in core_handler (signo=11, siginfo=0x7ffd173229f0, context=<optimized out>) at lib/sigevent.c:264
7  <signal handler called>
8  0x00007f17082fd7bc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
9  0x00007f17082ff6e2 in calloc () from /lib/x86_64-linux-gnu/libc.so.6
10 0x00007f1708451e78 in lh_table_new () from /lib/x86_64-linux-gnu/libjson-c.so.5
11 0x00007f170844c979 in json_object_new_object () from /lib/x86_64-linux-gnu/libjson-c.so.5
12 0x000055584e002fd9 in evpn_show_all_routes (vty=vty@entry=0x55584fb5ea00, bgp=bgp@entry=0x55584f82c600, type=<optimized out>, json=json@entry=0x55584f998130, detail=<optimized out>,
    self_orig=<optimized out>) at bgpd/bgp_evpn_vty.c:3192
13 0x000055584e009ed6 in show_bgp_l2vpn_evpn_route (self=<optimized out>, vty=0x55584fb5ea00, argc=6, argv=0x55584f998970) at bgpd/bgp_evpn_vty.c:5048
14 0x00007f170863af60 in cmd_execute_command_real (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, up_level=up_level@entry=0, filter=FILTER_RELAXED)
    at lib/command.c:1030
15 0x00007f170863b2be in cmd_execute_command (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1089
16 0x00007f170863b550 in cmd_execute (vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x55584fb65160 "sh bgp l2vpn evpn route json", matched=matched@entry=0x0, vtysh=vtysh@entry=0)
    at lib/command.c:1257
17 0x00007f17086acc77 in vty_command (vty=vty@entry=0x55584fb5ea00, buf=0x55584fb65160 "sh bgp l2vpn evpn route json") at lib/vty.c:503
18 0x00007f17086ad444 in vty_execute (vty=vty@entry=0x55584fb5ea00) at lib/vty.c:1266
19 0x00007f17086b06c8 in vtysh_read (thread=<optimized out>) at lib/vty.c:2165
20 0x00007f17086a798d in thread_call (thread=thread@entry=0x7ffd17325ce0) at lib/thread.c:2008
21 0x00007f1708660568 in frr_run (master=0x55584f22a120) at lib/libfrr.c:1223
22 0x000055584dfc8c96 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:555

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Update default-originate route-map actual map structure 15558/head
Donatas Abraitis [Fri, 15 Mar 2024 11:49:06 +0000 (13:49 +0200)]
bgpd: Update default-originate route-map actual map structure

If using with `bgp listen range ... peer-group x`, default_rmap[afi][safi] is not
updated, and after the hard-reset in other side, this is flushed and never updated
again without restarting the sender BGP daemon.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agozebra: fix route deletion during zebra shutdown 15424/head
Alexander Skorichenko [Wed, 28 Feb 2024 19:34:06 +0000 (20:34 +0100)]
zebra: fix route deletion during zebra shutdown

Split zebra's vrf_terminate() into disable() and delete() stages.
The former enqueues all events for the dplane thread.
Memory freeing is performed in the second stage.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
13 months agotests: bgp_sender_as_path_loop_detection add peer-group test 15553/head
Francois Dumontet [Wed, 13 Mar 2024 18:43:36 +0000 (19:43 +0100)]
tests: bgp_sender_as_path_loop_detection add peer-group test

add a tests of setting as-path-loop-detection through peer-group

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
13 months agoMerge pull request #15545 from donaldsharp/bgp_attr_dump
Donatas Abraitis [Fri, 15 Mar 2024 07:43:45 +0000 (09:43 +0200)]
Merge pull request #15545 from donaldsharp/bgp_attr_dump

bgpd: Add some missing data to `show bgp attribute-info`

13 months agozebra: changes for code maintainability 15552/head
sri-mohan1 [Thu, 14 Mar 2024 09:04:31 +0000 (14:34 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
13 months agobgpd: make as-path-loop-detection conform to the framework
Francois Dumontet [Wed, 13 Mar 2024 18:22:00 +0000 (19:22 +0100)]
bgpd: make as-path-loop-detection conform to the framework

currently:
when as-path-loop-detection is set on a peer-group.
members of the peer-group are not using that functionnality.

analysis:
the as-path-loop-detection, is not using the peer's flags
related framework.

fix:
use the peer's flag framework for as-path-loop-detection.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
13 months agobgpd: Add some missing data to `show bgp attribute-info` 15545/head
Donald Sharp [Wed, 13 Mar 2024 23:26:10 +0000 (19:26 -0400)]
bgpd: Add some missing data to `show bgp attribute-info`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: When using dev build add pointer information to %pBD 15520/head
Donald Sharp [Mon, 11 Mar 2024 14:40:22 +0000 (10:40 -0400)]
bgpd: When using dev build add pointer information to %pBD

When building FRR with `--enable-dev-build`.  Add a bit of
code to include the pointer value as part of the output.
Helps with tracking down issues and let's us see more data
when using the dev build option.

New output:

2024/03/08 19:48:56 BGP: [V0J1J-W5RHA] 11.0.20.1/32(0x5759ddf8d7c0) for 11.0.20.1/32

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15538 from idryzhov/fix-zebra-warning
Donatas Abraitis [Thu, 14 Mar 2024 08:38:24 +0000 (10:38 +0200)]
Merge pull request #15538 from idryzhov/fix-zebra-warning

zebra: fix compilation warnings

13 months agoMerge pull request #15466 from donaldsharp/bgp_filter_fun
Donatas Abraitis [Thu, 14 Mar 2024 08:25:14 +0000 (10:25 +0200)]
Merge pull request #15466 from donaldsharp/bgp_filter_fun

Bgp filter fun

13 months agobgpd: Avoid padding for bgp_paths_limit_capability struct 15533/head
Donatas Abraitis [Thu, 14 Mar 2024 07:45:18 +0000 (09:45 +0200)]
bgpd: Avoid padding for bgp_paths_limit_capability struct

When sending the packets over the network (dynamic capability) it reports 6 bytes
instead of 5 bytes, and causes some issues between little/big endian machines.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15501 from donaldsharp/fpm_listener_send_response
Donatas Abraitis [Thu, 14 Mar 2024 07:05:32 +0000 (09:05 +0200)]
Merge pull request #15501 from donaldsharp/fpm_listener_send_response

Fpm listener send response

13 months agobgpd: Ensure community data is freed in some cases. 15466/head
Donald Sharp [Sat, 2 Mar 2024 14:50:38 +0000 (09:50 -0500)]
bgpd: Ensure community data is freed in some cases.

Customer has this valgrind trace:

Direct leak of 2829120 byte(s) in 70728 object(s) allocated from:
  0 in community_new ../bgpd/bgp_community.c:39
  1 in community_uniq_sort ../bgpd/bgp_community.c:170
  2 in route_set_community ../bgpd/bgp_routemap.c:2342
  3 in route_map_apply_ext ../lib/routemap.c:2673
  4 in subgroup_announce_check ../bgpd/bgp_route.c:2367
  5 in subgroup_process_announce_selected ../bgpd/bgp_route.c:2914
  6 in group_announce_route_walkcb ../bgpd/bgp_updgrp_adv.c:199
  7 in hash_walk ../lib/hash.c:285
  8 in update_group_af_walk ../bgpd/bgp_updgrp.c:2061
  9 in group_announce_route ../bgpd/bgp_updgrp_adv.c:1059
 10 in bgp_process_main_one ../bgpd/bgp_route.c:3221
 11 in bgp_process_wq ../bgpd/bgp_route.c:3221
 12 in work_queue_run ../lib/workqueue.c:282

The above leak detected by valgrind was from a screenshot so I copied it
by hand.  Any mistakes in line numbers are purely from my transcription.
Additionally this is against a slightly modified 8.5.1 version of FRR.
Code inspection of 8.5.1 -vs- latest master shows the same problem
exists.  Code should be able to be followed from there to here.

What is happening:

There is a route-map being applied that modifes the outgoing community
to a peer.  This is saved in the attr copy created in
subgroup_process_announce_selected.  This community pointer is not
interned.  So the community->refcount is still 0.  Normally when
a prefix is announced, the attr and the prefix are placed on a
adjency out structure where the attribute is interned.  This will
cause the community to be saved in the community hash list as well.
In a non-normal operation when the decision to send is aborted after
the route-map application, the attribute is just dropped and the
pointer to the community is just dropped too, leading to situations
where the memory is leaked.  The usage of bgp suppress-fib would
would be a case where the community is caused to be leaked.
Additionally the previous commit where an unsuppress-map is used
to modify the outgoing attribute but since unsuppress-map was
not considered part of outgoing policy the attribute would be dropped as
well.  This pointer drop also extends to any dynamically allocated
memory saved by the attribute pointer that was not interned yet as well.

So let's modify the return case where the decision is made to
not send the prefix to the peer to always just flush the attribute
to ensure memory is not leaked.

Fixes: #15459
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Include unsuppress-map as a valid outgoing policy
Donald Sharp [Sat, 2 Mar 2024 14:42:30 +0000 (09:42 -0500)]
bgpd: Include unsuppress-map as a valid outgoing policy

If unsuppress-map is setup for outgoing peers, consider that
policy is being applied as for RFC 8212.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Ensure that the correct aspath is free'd
Donald Sharp [Wed, 13 Mar 2024 14:26:58 +0000 (10:26 -0400)]
bgpd: Ensure that the correct aspath is free'd

Currently in subgroup_default_originate the attr.aspath
is set in bgp_attr_default_set, which hashs the aspath
and creates a refcount for it.  If this is a withdraw
the subgroup_announce_check and bgp_adj_out_set_subgroup
is called which will intern the attribute.  This will
cause the the attr.aspath to be set to a new value
finally at the bottom of the function it intentionally
uninterns the aspath which is not the one that was
created for this function.  This reduces the other
aspath's refcount by 1 and if a clear bgp * is issued
fast enough the aspath for that will be removed
and the system will crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15532 from opensourcerouting/fix/vrf_default_originate
Jafar Al-Gharaibeh [Wed, 13 Mar 2024 21:44:03 +0000 (16:44 -0500)]
Merge pull request #15532 from opensourcerouting/fix/vrf_default_originate

bgpd: Check the route and the nexthop appropriately when validating NH

13 months agotests: Check if Paths-Limit capability is working dynamically
Donatas Abraitis [Tue, 12 Mar 2024 18:30:46 +0000 (20:30 +0200)]
tests: Check if Paths-Limit capability is working dynamically

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Set Paths Limit to 0 instead of unsetting the capability
Donatas Abraitis [Tue, 12 Mar 2024 19:14:13 +0000 (21:14 +0200)]
bgpd: Set Paths Limit to 0 instead of unsetting the capability

The capability should be untouched, and send 0 (unlimited) instead.

Otherwise, we miss the capability and things are broken later until the
session reset.

Fixes: 72f0e06824c237238121b96c45845a57e5cfb59f ("bgpd: Implement Paths-Limit capability")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Show Addpath capability TX/RX flags unconditionally
Donatas Abraitis [Tue, 12 Mar 2024 19:00:50 +0000 (21:00 +0200)]
bgpd: Show Addpath capability TX/RX flags unconditionally

It's very annoying when testing and instead of looking for true/false, you
have to check if the field exists.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15531 from donaldsharp/ospf6_list
Mark Stapp [Wed, 13 Mar 2024 12:39:26 +0000 (08:39 -0400)]
Merge pull request #15531 from donaldsharp/ospf6_list

eigrpd, mgmtd, ospf6d: frr_fini is last

13 months agoMerge pull request #15526 from sri-mohan1/srib-24-zebra-a
Donatas Abraitis [Wed, 13 Mar 2024 10:41:07 +0000 (12:41 +0200)]
Merge pull request #15526 from sri-mohan1/srib-24-zebra-a

zebra: changes for code maintainability

13 months agobgpd: Check the route and the nexthop appropriately when validating NH 15532/head
Donatas Abraitis [Tue, 12 Mar 2024 17:48:26 +0000 (19:48 +0200)]
bgpd: Check the route and the nexthop appropriately when validating NH

A route and its nexthop might belong to different VRFs. Therefore, we need
both the bgp and bgp_nexthop pointers.

Fixes: 8d51fafdcbef3dcf06df796e4f9b83d2bbd5edc2 ("bgpd: Drop bgp_static_update_safi() function")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agozebra: Add ability to pretend routes are offloaded 15501/head
Donald Sharp [Thu, 7 Mar 2024 01:53:20 +0000 (20:53 -0500)]
zebra: Add ability to pretend routes are offloaded

In the fpm_listener add a -r option to allow for
routes to be notified back to zebra that the route
has been `offloaded` properly.

fpm_listener output:
New route 4.5.6.7/32, Prot: Static(196), Metric: 20, nhgid: 23
  Route Static(196) reflecting back
FPM message - Type: 1, Length 56
New route 169.254.0.0/16, Prot: Kernel(2), Metric: 20, nhgid: 2
FPM message - Type: 1, Length 56
New route 192.168.99.0/24, Prot: Kernel(2), Metric: 20, nhgid: 42
FPM message - Type: 1, Length 56
New route 192.168.99.1/32, Prot: Kernel(2), Metric: 20, nhgid: 42
FPM message - Type: 1, Length 56
New route 192.168.119.0/24, Prot: OSPF(188), Metric: 20, nhgid: 20
  Route OSPF(188) reflecting back

Zebra output:

2024-03-06 21:48:54.613 [DEBG] zebra: [TJXPZ-RC5XQ] default(0:254):4.5.6.7/32 Processing dplane notif ctx 0x7160b4008780
2024-03-06 21:48:54.613 [DEBG] zebra: [TJXPZ-RC5XQ] default(0:254):192.168.119.0/24 Processing dplane notif ctx 0x7160b4008780

eva# show ip route 4.5.6.7 json
{
  "4.5.6.7/32":[
    {
      "prefix":"4.5.6.7/32",
      "prefixLen":32,
      "protocol":"static",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      "destSelected":true,
      "distance":1,
      "metric":0,
      "installed":true,
      "offloaded":true,
....

and

eva# show ip route 192.168.119.0 json
{
  "192.168.119.0/24":[
    {
      "prefix":"192.168.119.0/24",
      "prefixLen":24,
      "protocol":"ospf",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      "destSelected":true,
      "distance":110,
      "metric":100,
      "installed":true,
      "offloaded":true,
...

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: fpm_listener start adding data about nexthops
Donald Sharp [Thu, 7 Mar 2024 02:02:27 +0000 (21:02 -0500)]
zebra: fpm_listener start adding data about nexthops

Start some very small bit of work into the fpm_listener
about RTM_NEWNEXTHOPS.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: Add some additional known protocols for fpm_listener
Donald Sharp [Thu, 7 Mar 2024 01:33:23 +0000 (20:33 -0500)]
zebra: Add some additional known protocols for fpm_listener

Just add a few more of the known protocols.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoeigrpd, mgmtd, ospf6d: frr_fini is last 15531/head
Donald Sharp [Tue, 12 Mar 2024 17:12:48 +0000 (13:12 -0400)]
eigrpd, mgmtd, ospf6d: frr_fini is last

I noticed that ospf6d always had a linked list memory leak.
Tracking it down shows that frr_fini() shuts down the memory
system and prints out memory not cleaned up.  eigrpd, mgmtd
and ospf6d all called cleanup functions after frr_fini leaving
memory leaked that was not really leaked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: fix compilation warnings 15538/head
Igor Ryzhov [Tue, 12 Mar 2024 23:35:51 +0000 (01:35 +0200)]
zebra: fix compilation warnings

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15539 from donaldsharp/cleanup_leaky_sieve
Donatas Abraitis [Wed, 13 Mar 2024 07:07:57 +0000 (09:07 +0200)]
Merge pull request #15539 from donaldsharp/cleanup_leaky_sieve

zebra: Cleanup leaked memory on shutdown from GR code

13 months agozebra: Cleanup leaked memory on shutdown from GR code 15539/head
Donald Sharp [Wed, 13 Mar 2024 01:15:29 +0000 (21:15 -0400)]
zebra: Cleanup leaked memory on shutdown from GR code

Recent commit: 6b2554b94a
Exposed, via Address Sanitation, that memory was being
leaked.  Unfortunately the CI system did not catch this.

Two pieces of memory were being lost: The zserv client
data structure as well as anything on the client->gr_info_queue.
Clean these up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15457 from opensourcerouting/fix/docker_builds_for_10.0
Russ White [Tue, 12 Mar 2024 13:52:39 +0000 (09:52 -0400)]
Merge pull request #15457 from opensourcerouting/fix/docker_builds_for_10.0

docker: Fix build for Alpine Linux after the recent changes since 9.1

13 months agozebra: changes for code maintainability 15526/head
sri-mohan1 [Tue, 12 Mar 2024 05:36:35 +0000 (11:06 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
13 months agoMerge pull request #15523 from donaldsharp/lib_mtype_cleanup
Donatas Abraitis [Tue, 12 Mar 2024 06:14:10 +0000 (07:14 +0100)]
Merge pull request #15523 from donaldsharp/lib_mtype_cleanup

Lib mtype cleanup

13 months agolib: Remove MTYPE_SYSREPO it is not used 15523/head
Donald Sharp [Mon, 11 Mar 2024 20:52:51 +0000 (16:52 -0400)]
lib: Remove MTYPE_SYSREPO it is not used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agolib: Remove unused MTYPE_MSG_NATIVE_MSG
Donald Sharp [Mon, 11 Mar 2024 20:52:21 +0000 (16:52 -0400)]
lib: Remove unused MTYPE_MSG_NATIVE_MSG

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agolib: Remove unused mtypes from affinitymap.c
Donald Sharp [Mon, 11 Mar 2024 20:07:14 +0000 (16:07 -0400)]
lib: Remove unused mtypes from affinitymap.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: Clean up leaked linklist data structure on shutdown
Donald Sharp [Mon, 11 Mar 2024 20:05:56 +0000 (16:05 -0400)]
zebra: Clean up leaked linklist data structure on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15411 from raja-rajasekar/rajasekarr/backpressure_bgp_zebra_zserv
Mark Stapp [Mon, 11 Mar 2024 20:04:13 +0000 (16:04 -0400)]
Merge pull request #15411 from raja-rajasekar/rajasekarr/backpressure_bgp_zebra_zserv

zebra: backpressure - Zebra push back on Buffer/Stream creation

13 months agoMerge pull request #15517 from idryzhov/fix-yang-notif-actions
Donald Sharp [Mon, 11 Mar 2024 19:47:17 +0000 (15:47 -0400)]
Merge pull request #15517 from idryzhov/fix-yang-notif-actions

lib: fix initialization of northbound nodes

13 months agolib: Remove unused memory types
Donald Sharp [Mon, 11 Mar 2024 17:04:09 +0000 (13:04 -0400)]
lib: Remove unused memory types

These are never used.  So let's remove them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15516 from opensourcerouting/freebsd-printf-sync-20240310
Donald Sharp [Mon, 11 Mar 2024 14:32:32 +0000 (10:32 -0400)]
Merge pull request #15516 from opensourcerouting/freebsd-printf-sync-20240310

lib/printf: pick up ISO C23 / N2680 from FreeBSD

13 months agoMerge pull request #15513 from opensourcerouting/fix/bgp_default_software_version
Donald Sharp [Mon, 11 Mar 2024 11:17:09 +0000 (07:17 -0400)]
Merge pull request #15513 from opensourcerouting/fix/bgp_default_software_version

bgpd: Fix `no` form for `neighbor X capability software-version`

13 months agoMerge pull request #15514 from opensourcerouting/fix/bgp_dynamic_capability_handle_unset
Donald Sharp [Mon, 11 Mar 2024 11:16:24 +0000 (07:16 -0400)]
Merge pull request #15514 from opensourcerouting/fix/bgp_dynamic_capability_handle_unset

bgpd: Unset advertised capabilities if capability is disabled

13 months agolib: fix initialization of northbound nodes 15517/head
Igor Ryzhov [Sun, 10 Mar 2024 15:35:21 +0000 (17:35 +0200)]
lib: fix initialization of northbound nodes

When actions and notification are defined as descendants of other nodes,
they are not getting initialized, because the iterator skips them. Fix
the iterator to include them when traversing the schema.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15515 from opensourcerouting/zlog-recirculate-ldpd
Donald Sharp [Sun, 10 Mar 2024 17:12:46 +0000 (13:12 -0400)]
Merge pull request #15515 from opensourcerouting/zlog-recirculate-ldpd

ldpd, lib: integrate lde/ldpe into standard logging infrastructure

13 months agotests: Check if capabilities can be disabled via dynamic capabilities 15514/head
Donatas Abraitis [Sun, 10 Mar 2024 16:51:05 +0000 (18:51 +0200)]
tests: Check if capabilities can be disabled via dynamic capabilities

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Allow dynamically disable graceful-restart/long-lived graceful-restart
Donatas Abraitis [Sun, 10 Mar 2024 16:25:30 +0000 (18:25 +0200)]
bgpd: Allow dynamically disable graceful-restart/long-lived graceful-restart

If we enter `bgp graceful-restart-disable`, make sure we disable the capabilities.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agodoc: update re. ISO C23 printf changes 15516/head
David Lamparter [Sun, 10 Mar 2024 12:40:19 +0000 (13:40 +0100)]
doc: update re. ISO C23 printf changes

The new `%w99d` fixed-width modifier still needs work in `frr-format`,
which unfortunately is not as trivial as `%b` was.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agolib/printf: update README
David Lamparter [Sun, 10 Mar 2024 12:21:37 +0000 (13:21 +0100)]
lib/printf: update README

Make a note that `%w[f](8|16|32|64)d` was picked up.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agotests: exercise `%w`/`%wf` printfrr modifiers
David Lamparter [Sun, 10 Mar 2024 12:30:46 +0000 (13:30 +0100)]
tests: exercise `%w`/`%wf` printfrr modifiers

Added by ISO C23 / N2680, implementation imported from FreeBSD.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agolib/printf: Implement N2680.
Dag-Erling Smørgrav [Thu, 7 Sep 2023 06:14:44 +0000 (06:14 +0000)]
lib/printf: Implement N2680.

This adds specific width length modifiers in the form of wN and wfN
(where N is 8, 16, 32, or 64) which allow printing intN_t and
int_fastN_t without resorting to casts or PRI macros.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41725

FRR changes only include printf(), scanf/strtol are not locally
implemented in FRR.  Also added "(void) 0" to empty "else ..." to
avoid a compiler warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from FreeBSD commit bce0bef3c6abab92c7ac8cc23b7cc632a382721e)

13 months agoldpd: use zlog recirculation for subprocesses 15515/head
David Lamparter [Thu, 25 Jan 2024 21:54:54 +0000 (22:54 +0100)]
ldpd: use zlog recirculation for subprocesses

This way, full functionality of `zlog_*` is available.

Having `fatal()` be wrappers around `assertf()` also means we get
backtraces, which is not the case for a plain `exit(1)`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agolib: allow recirculating/relaying log messages
David Lamparter [Thu, 25 Jan 2024 21:11:44 +0000 (22:11 +0100)]
lib: allow recirculating/relaying log messages

This is primarily intended for ldpd with its split-process architecture.
The LDE/LDPE subprocesses currently lose the extended zlog
functionality.

The zlog_live target already encapsulates all necessary bits for vtysh.
Reuse it for a relay function to be used in the main ldpd process.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agobgpd: Unset advertised capabilities if capability is disabled
Donatas Abraitis [Sat, 9 Mar 2024 20:17:27 +0000 (22:17 +0200)]
bgpd: Unset advertised capabilities if capability is disabled

When using dynamic capabilities, do not forget to unset advertised capabilities.

Otherwise, it's kept as advertised.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Fix `no` form for `neighbor X capability software-version` 15513/head
Donatas Abraitis [Sat, 9 Mar 2024 19:52:17 +0000 (21:52 +0200)]
bgpd: Fix `no` form for `neighbor X capability software-version`

If `bgp default software-version-capability` is enabled, allow unsetting this
for a single neighbor also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15510 from idryzhov/fix-rip-ripng-rpc
Donatas Abraitis [Sat, 9 Mar 2024 10:15:20 +0000 (11:15 +0100)]
Merge pull request #15510 from idryzhov/fix-rip-ripng-rpc

fix rip/ripng yang rpcs

13 months agolib: Drop include/linux/mroute[6].h 15457/head
Donatas Abraitis [Sat, 9 Mar 2024 07:34:41 +0000 (09:34 +0200)]
lib: Drop include/linux/mroute[6].h

Not needed anymore since https://github.com/FRRouting/frr/pull/15509/commits/a5389154a1363ea778e0cafddc34f1964631278c.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agodocker: Fix post function for Alpine build (package)
Donatas Abraitis [Thu, 29 Feb 2024 12:43:57 +0000 (14:43 +0200)]
docker: Fix post function for Alpine build (package)

It was using a wrong sysdir.

```
--------------------
  72 |     # Own the config / PID files
  73 |     RUN mkdir -p /var/run/frr
  74 | >>> RUN chown -R frr:frr /etc/frr /var/run/frr
  75 |
  76 |     # Simple init manager for reaping processes and forwarding signals
--------------------
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agodocker: Do not use pip Python package manager
Donatas Abraitis [Thu, 29 Feb 2024 12:37:40 +0000 (14:37 +0200)]
docker: Do not use pip Python package manager

Alpine Linux gets this with 3.19:

This is already installed with `pytest` via apk package manager.

```
15 78.20 error: externally-managed-environment
15 78.20
15 78.20 × This environment is externally managed
15 78.20 ╰─>
15 78.20     The system-wide python installation should be maintained using the system
15 78.20     package manager (apk) only.
15 78.20
15 78.20     If the package in question is not packaged already (and hence installable via
15 78.20     "apk add py3-somepackage"), please consider installing it inside a virtual
15 78.20     environment, e.g.:
15 78.20
15 78.20     python3 -m venv /path/to/venv
15 78.20     . /path/to/venv/bin/activate
15 78.20     pip install mypackage
15 78.20
15 78.20     To exit the virtual environment, run:
15 78.20
15 78.20     deactivate
15 78.20
15 78.20     The virtual environment is not deleted, and can be re-entered by re-sourcing
15 78.20     the activate file.
15 78.20
15 78.20     To automatically manage virtual environments, consider using pipx (from the
15 78.20     pipx package).
15 78.20
15 78.20 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agodocker: Use Alpine Linux version 3.19
Donatas Abraitis [Thu, 29 Feb 2024 12:35:17 +0000 (14:35 +0200)]
docker: Use Alpine Linux version 3.19

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agovtysh: Include fnctl.h for vtysh_main
Donatas Abraitis [Thu, 29 Feb 2024 12:21:27 +0000 (14:21 +0200)]
vtysh: Include fnctl.h for vtysh_main

Fixing compilation for Alpine Linux:

```
25 91.59 vtysh/vtysh_main.c: In function 'vtysh_flock_config':
25 91.59 vtysh/vtysh_main.c:276:20: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration]
25 91.59   276 |         flock_fd = open(flock_file, O_RDONLY, 0644);
25 91.59       |                    ^~~~
25 91.59       |                    popen
25 91.60 vtysh/vtysh_main.c:276:37: error: 'O_RDONLY' undeclared (first use in this function)
25 91.60   276 |         flock_fd = open(flock_file, O_RDONLY, 0644);
25 91.60       |                                     ^~~~~~~~
25 91.60 vtysh/vtysh_main.c:276:37: note: each undeclared identifier is reported only once for each function it appears in
25 91.60   CC       zebra/if_netlink.o
25 91.61 vtysh/vtysh_main.c: In function 'main':
25 91.61 vtysh/vtysh_main.c:637:49: error: 'O_CREAT' undeclared (first use in this function)
25 91.61   637 |                         fp = open(history_file, O_CREAT | O_EXCL,
25 91.61       |                                                 ^~~~~~~
25 91.62 vtysh/vtysh_main.c:637:59: error: 'O_EXCL' undeclared (first use in this function)
25 91.62   637 |                         fp = open(history_file, O_CREAT | O_EXCL,
25 91.62       |                                                           ^~~~~~
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agolib: Fix unknown sig_atomic_t compile error
Donatas Abraitis [Thu, 29 Feb 2024 12:17:20 +0000 (14:17 +0200)]
lib: Fix unknown sig_atomic_t compile error

This is happening for Alpine Linux.

```
26 64.59 ./lib/sigevent.h:23:18: error: unknown type name 'sig_atomic_t'
26 64.59    23 |         volatile sig_atomic_t caught; /* private member   */
26 64.59       |                  ^~~~~~~~~~~~
26 64.60 In file included from ./lib/libfrr.h:12,
26 64.60                  from ./lib/vty.h:28,
26 64.60                  from ./lib/command.h:11,
26 64.60                  from ./lib/debug.h:11,
26 64.60                  from ./mgmtd/mgmt.h:12,
26 64.60                  from mgmtd/mgmt_history.c:14:
26 64.60 ./lib/sigevent.h:23:18: error: unknown type name 'sig_atomic_t'
26 64.60    23 |         volatile sig_atomic_t caught; /* private member   */
26 64.60       |                  ^~~~~~~~~~~~
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agodocker: Use libyang 2.1.128 for Alpine builds
Donatas Abraitis [Thu, 29 Feb 2024 12:08:50 +0000 (14:08 +0200)]
docker: Use libyang 2.1.128 for Alpine builds

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15509 from donaldsharp/freebsd_cleanups
Donatas Abraitis [Sat, 9 Mar 2024 07:31:48 +0000 (08:31 +0100)]
Merge pull request #15509 from donaldsharp/freebsd_cleanups

pimd: Cleanup inclusion of headers

13 months agoripngd: fix "clear ipv6 ripng" command 15510/head
Igor Ryzhov [Fri, 8 Mar 2024 22:01:01 +0000 (00:01 +0200)]
ripngd: fix "clear ipv6 ripng" command

mgmtd doesn't support YANG RPCs yet, so this command must go directly to
ripngd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoripd: fix "clear ip rip" command
Igor Ryzhov [Fri, 8 Mar 2024 22:00:12 +0000 (00:00 +0200)]
ripd: fix "clear ip rip" command

mgmtd doesn't support YANG RPCs yet, so this command must go directly to
ripd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agopimd: Cleanup inclusion of headers 15509/head
Donald Sharp [Fri, 8 Mar 2024 18:04:34 +0000 (18:04 +0000)]
pimd: Cleanup inclusion of headers

FRR needs to properly include the FreeBSD headers for
compilation on FreeBSD.  I have setup v6 as well
but I have not even tested it.  Since I know
that the form is the same I think this is ok
at the moment.  This is a step forward.

Because of this change *clearly* no-one is even
using pim on FreeBSD.  <look at the MRT_XXX values
to prove to yourself>.  In any event this is a step
in the direction of getting that working again.

Signed-off-by: Donald Sharp <sharpd@freebsd.network>
13 months agoMerge pull request #15469 from LabNConsulting/chopps/keychain-yang
Donald Sharp [Fri, 8 Mar 2024 13:15:02 +0000 (08:15 -0500)]
Merge pull request #15469 from LabNConsulting/chopps/keychain-yang

add ietf-key-chain YANG module support

13 months agoMerge pull request #15497 from idryzhov/show-run-fixes
Donald Sharp [Fri, 8 Mar 2024 13:11:14 +0000 (08:11 -0500)]
Merge pull request #15497 from idryzhov/show-run-fixes

a couple of fixes for "show running-config"

13 months agoMerge pull request #15506 from fdumontet6WIND/local_link
Donatas Abraitis [Fri, 8 Mar 2024 07:19:25 +0000 (08:19 +0100)]
Merge pull request #15506 from fdumontet6WIND/local_link

ospf6d: add localLinkLocalAddress field

13 months agozebra: backpressure - Zebra push back on Buffer/Stream creation 15411/head
Rajasekar Raja [Mon, 12 Feb 2024 18:44:18 +0000 (10:44 -0800)]
zebra: backpressure - Zebra push back on Buffer/Stream creation

Currently, the way zebra works is it creates pthread per client (BGP is
of interest in this case) and this thread loops itself in zserv_read()
to check for any incoming data. If there is one, then it reads,
validates and adds it in the ibuf_fifo signalling the main thread to
process the message. The main thread when it gets a change, processes
the message, and invokes the function pointer registered in the header
command. (Ex: zserv_handlers).

Finally, if all of this was successful, this task reschedules itself and
loops in zserv_read() again

However, if there are already items on ibuf FIFO, that means zebra is
slow in processing. And with the current mechanism if Zebra main is
busy, the ibuf FIFO keeps growing holding up the memory.

Show memory zebra:(Example: 15k streams hoarding ~160 MB of data)
--- qmem libfrr ---
Stream             :       44 variable   3432352    15042 161243800

Fix:
Client IO Thread: (zserv_read)
 - Stop doing the read events when we know there are X number of items
   on the FIFO already.(X - zebra zapi-packets <1-10000> (Default-1000)

 - Determine the number of items on the zserv->ibuf_fifo. Subtract this
   from the work items and only pull the number of items off that would
   take us to X items on the ibuf_fifo again.

 - If the number of items in the ibuf_fifo has reached to the maximum
      * Either initially when zserv_read() is called (or)
      * when processing the remainders of the incoming buffer
   the client IO thread is woken by the the zebra main.

Main thread: (zserv_process_message)
If the client ibuf always schedules a wakeup to the client IO to read
more items from the socked buffer. This way we ensure
 - Client IO thread always tries to read the socket buffer and add more
   items to the ibuf_fifo (until max limit)
 - hidden config change (zebra zapi-packets <>) is taken into account

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
13 months agoospf6d: add localLinkLocalAddress field 15506/head
Francois Dumontet [Thu, 7 Mar 2024 13:33:37 +0000 (14:33 +0100)]
ospf6d: add localLinkLocalAddress field

add localIfaceAdress field in show ipv6 ospf6 neighbor detail json
command.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoMerge pull request #15498 from idryzhov/mgmt-change-error
Donatas Abraitis [Thu, 7 Mar 2024 07:25:29 +0000 (08:25 +0100)]
Merge pull request #15498 from idryzhov/mgmt-change-error

mgmtd: change error message

13 months agomgmtd: change error message 15498/head
Igor Ryzhov [Wed, 6 Mar 2024 21:57:30 +0000 (23:57 +0200)]
mgmtd: change error message

Make the wording clearer about what's going on.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoripngd: fix missing "exit" for "router ripng" 15497/head
Igor Ryzhov [Wed, 6 Mar 2024 19:43:44 +0000 (21:43 +0200)]
ripngd: fix missing "exit" for "router ripng"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoripd: fix missing "exit" for "router rip"
Igor Ryzhov [Wed, 6 Mar 2024 19:42:53 +0000 (21:42 +0200)]
ripd: fix missing "exit" for "router rip"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agolib: fix order of interfaces in the config
Igor Ryzhov [Wed, 6 Mar 2024 19:41:35 +0000 (21:41 +0200)]
lib: fix order of interfaces in the config

Add missing cli_cmp callback. Without it, interfaces are not sorted and
printed in order they were created.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15487 from idryzhov/nb-apply-finish
Donatas Abraitis [Wed, 6 Mar 2024 06:44:09 +0000 (08:44 +0200)]
Merge pull request #15487 from idryzhov/nb-apply-finish

lib: fix apply_finish callback in northbound

13 months agoMerge pull request #15486 from donaldsharp/make_prefix
Donatas Abraitis [Wed, 6 Mar 2024 06:43:40 +0000 (08:43 +0200)]
Merge pull request #15486 from donaldsharp/make_prefix

bgpd: pi->attr is deref'ed in all paths leading up to test