Commit Graph

5364 Commits

Author SHA1 Message Date
Donald Sharp
df6eb0bd7b lib, mgmtd: Use short memory names so they fit within vty output
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-19 21:31:35 -04:00
Donald Sharp
b6ab009b99 lib: Fix overlapping memory type
Make a unique memory type so we are not overlapping another one.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-19 21:31:35 -04:00
Donatas Abraitis
a8bc67a989
Merge pull request #13369 from samanvithab/bgpd_fix
lib : fix duplicate prefix list delete
2023-05-18 10:24:41 +03:00
Russ White
425fc1f5b7
Merge pull request #12949 from opensourcerouting/ospf-unplanned-gr
OSPF GR for unplanned outages
2023-05-16 08:37:19 -04:00
David Lamparter
cf0eeb3dc1
Merge pull request #12050 from LabNConsulting/working/lb/topotest-220909 2023-05-16 08:31:06 +02:00
Lou Berger
4d28aea958 lib: when running as a daemon, only redirect sdtin, stdout, sdterr to null when a tty.
Also write memstat to stderr when stderr is not a tty
     and allow for --log stdout

Signed-off-by: Lou Berger <lberger@labn.net>
2023-05-11 07:38:25 -04:00
Donatas Abraitis
1c035c8c2c bgpd: Implement match source-protocol for route-maps
The main idea is to filter routes by matching source (originating) protocol
for outgoing direction. For instance, filter outgoing routes to an arbitrary
router that are static only. Or filter out only routes learned from RIP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-11 11:39:23 +03:00
Samanvitha B Bhargav
394ed767e7 lib : fix duplicate prefix list delete
Problem statement:
Step-1:
pl1 - 10.10.10.10/24 with deny sequence 1
Step-2:
pl1 - 10.10.10.10/24 with permit sequence 2
Step-3:
pl1 - 20.20.20.20/24 with deny sequence 1

Now we end up deleting permit sequence 2,
which might blackhole the traffic.

RCA:
Whenever we have multiple prefix lists,
having same prefix and different subnet range,
delete or replace of prefix list
would result in delete of entry in route-map
prefix table.

Fix:
We will skip deleting prefix list entry
from routemap prefix table, if we have
the multiple prefix lists having same prefix.

Signed-off-by: Samanvitha B Bhargav <bsamanvitha@vmware.com>
2023-05-09 02:23:44 -07:00
Renato Westphal
0c05ceae00 ospfd, ospf6d: introduce the "graceful-restart hello-delay" command
This command makes unplanned GR more reliable by manipulating the
sending of Grace-LSAs and Hello packets for a certain amount of time,
increasing the chance that the neighboring routers are aware of
the ongoing graceful restart before resuming normal OSPF operation.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-08 21:47:44 -03:00
Mark Stapp
eb4c026d13
Merge pull request #13413 from chiragshah6/fdev2
zebra: re-install NHG on interface up
2023-05-08 14:36:07 -04:00
Ashwini Reddy
5bb87732f6 zebra: re-install nhg on interface up
Intermittently zebra and kernel are out of sync
when interface flaps and the add's/dels are in
same processing queue and zebra assumes no change in nexthop.
Hence we need to bring in a reinstall to kernel
of the nexthops and routes to sync their states.

Upon interface flap kernel would have deleted NHGs
associated to a interface (the one flapped),
zebra retains NHGs for 3 mins even though upper
layer protocol removes the nexthops (associated NHG).
As part of interface address add ,
re-add singleton NHGs associated to interface.

Ticket: #3173663
Issue: 3173663

Signed-off-by: Ashwini Reddy <ashred@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-05-05 14:37:52 -07:00
Christian Hopps
3701780a15 lib: log commands read from config file
When the user specifies `--command-log-always` in CLI arguments then also log
commands executed from loading the config file.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-04 14:48:59 -04:00
Russ White
d0053da26b
Merge pull request #13376 from louis-6wind/fix-flex-algo-mem-leak
isisd, lib: fix flex-algo memory leak
2023-05-02 11:33:38 -04:00
Russ White
b9f0c8c8d0
Merge pull request #13404 from louis-6wind/fix-flex-algo-race-condition
isisd: fix a flex algo race condition and a minor fix
2023-05-02 10:42:39 -04:00
Russ White
9ab0661b89
Merge pull request #13235 from Orange-OpenSource/link-state
lib: Fix memory leaks in Link State library
2023-05-02 10:31:10 -04:00
Donald Sharp
0313343d0a
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
mgmtd: fully implement debug flags for mgmtd and clients
2023-05-02 08:17:17 -04:00
Christian Hopps
cfa0facbf9 mgmtd: fully implement debug flags for mgmtd and clients
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-01 13:47:12 -04:00
Christian Hopps
6b7481aa8d lib: add build option to set startup log timestemp precision
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29 02:36:06 -04:00
Louis Scalbert
cc1f9bd9e2 lib: fix comparaison of flex-algo definition
Fix comparaison of flex-algo definition by comparing all the definition
statements.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-28 11:53:18 +02:00
Louis Scalbert
3f55b8c621 isisd: fix disabled flex-algo on race condition
A particular flex-algo algorithm may remain in disabled state after
configuring it if its flex-algo definition is being spread in the area.

It happens sometimes that, in isis_sr_flex_algo_topo1 topotest, r3
flex-algo 203 is disabled on test8. It depends on the following
sequence on r3:
 1. a LSP containing the flex-algo 203 definition is received from
    either r1 or r2 (or both).
 2. the local LSP is rebuilt by lsp_build() because of the flex-algo 203
    configuration
 3. isis_run_spf() recomputes the algo 203 SPF tree

A 1. 2. 3. sequence results in a working test whereas 2. 1. 3. is not
working. The second case issue is because of an inconsistent flex-algo
definition state between the following:
 - in lsp_build(), isis_flex_algo_elected_supported_local_fad() returns
   false because no flex-algo definition is known.
 - in isis_run_spf(), isis_flex_algo_elected_supported() returns true
   because a flex-algo definition is found.

Set a flex-algo state lsp_build() depending on flex-algo definition
existence that is used later in isis_run_spf().

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-28 11:53:18 +02:00
Louis Scalbert
5c28462596 isisd, lib: clarify sizeof on flex-algo memory allocation
Use the struct instead of the pointer for flex-algo memory allocation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-27 15:39:21 +02:00
Louis Scalbert
87acad8698 isisd, lib: fix flex-algo database memory leak at area destruction
Free flex-algorithm database memory when an IS-IS area is destroyed.

Fixes: 735fb37db1 ("lib: add library for igp flexible-algorithm")
Fixes: 7f198e063c ("isisd: add isis flex-algo base interface")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-27 15:37:36 +02:00
Louis Scalbert
5b3e0735cc lib: dispatch flex_algo_delete()
Dispatch flex_algo_delete() to prepare the next commit. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-27 15:36:15 +02:00
Louis Scalbert
8766fceefc lib: move flex_algo_delete() just after flex_algo_alloc()
Move flex_algo_delete() just after flex_algo_alloc(). No change on code.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-27 15:35:56 +02:00
Louis Scalbert
8b8861401a lib: clarify flex-algo mtype
Clarify flex-algo MTYPE by creating a specific MTYPE definition to the
database of flex-algo information.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-27 15:35:50 +02:00
Mark Stapp
b38aed324d
Merge pull request #13374 from opensourcerouting/build-fix-rmap-yang
build: fix frr-if-rmap.yang model embedding
2023-04-25 15:26:19 -04:00
Russ White
4855ca5e56
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community
bgpd: Add Node Target Extended Communities support
2023-04-25 11:06:23 -04:00
Christian Hopps
7f6b20074f lib: fix style warns and get rid of "!" for success
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 11:20:48 -04:00
David Lamparter
edaee5461d build: fix frr-if-rmap.yang model embedding
This was missed somewhere along the line, causing ripd to not start.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-24 17:02:34 +02:00
Christian Hopps
9b96394d05
Merge pull request #13149 from pushpasis/mgmt_cleanup_zlog
mgmtd, lib: Cleanup zlog_err()
2023-04-24 11:00:08 -04:00
Donald Sharp
3eefea9249
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
lib: typesafe shenanigans
2023-04-23 15:06:59 -04:00
Olivier Dugeon
30584b6f6a lib: Fix memory leak in in Link State
When using ls_stream2ted() function to parse Opaque Link State message to local
TED, in case of vertex or subnet deletion, the function return a pointer to the
deleted ls_element instead of NULL. This could lead into a potential pointer
corruption when caller try to access to the deleted ls_element.

This patch ensure that the ls_element pointer return by ls_stream2ted()
function is NULL when the message event is a delete operation for vertex and
subnet. Note that edge deletion was correctly handled.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-21 18:24:51 +02:00
Olivier Dugeon
871b46e7eb lib: Link State memory corruption
In function ls_find_subnet(), prefix argument is directly copied into
subnet.key structure to find corresponding subnet in RB Tree. This could leadr
to a memory corruption. Function prefix_copy() must be used instead.

This patch replaces the direct prefix copy by a call to prefix_copy() function
to avoid this memory issue.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-21 18:09:28 +02:00
David Lamparter
5523a505f4 lib: fix _hash_member() crash w/ empty hash
The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.

Test case added to tests/lib/test_typelist.

Note this function is not currently used anywhere.  Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 16:30:32 +02:00
David Lamparter
ae19023b8e lib: typesafe hash table breadcrumbs
Looking at the coverity report, it complains that tabshift could be
zero, resulting in a uint32_t shifted by 33 (which is undefined.)

As I was confused by the "+ 1", in addition to the SA assume(), leave
some breadcumbs for next time this comes up.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-21 16:27:21 +02:00
Donald Sharp
a7209c2dbc lib: Make coverity happy about close
The error condition handled both failure to open
and a fstat failure.  Just double check that the close
is appropriate to call.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-21 09:12:08 -04:00
Philippe Guibert
7b343a9ed5
Merge pull request #12933 from Orange-OpenSource/link_state
lib: Update edge key in link state database
2023-04-20 18:33:21 +02:00
Donatas Abraitis
5db1931962
Merge pull request #13166 from Jafaral/ospf-external-metric
ospfd: use rib metric as the base for set metric +/-
2023-04-19 21:11:25 +03:00
Olivier Dugeon
fd4377d9a5
Merge pull request #11667 from louis-6wind/flexalgo-mpls
isisd: Flex-Algo for SR-MPLS
2023-04-18 14:45:30 +02:00
Eric Kinzie
42bf1afa5a lib: convert termtable to json
Add a function that returns a JSON-C structure containing a representation
of a termtable.  This is intended to be a quick way to implement JSON
output to CLI commands.

Signed-off-by: Eric Kinzie <ekinzie@labn.net>
2023-04-18 11:33:15 +02:00
Louis Scalbert
72eae2c3cb lib: add a frr_each_const macro
Add a frr_each_const macro equivalent to loop on const lists.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:13:59 +02:00
Hiroki Shirokura
46fb37cf67 lib,vtysh,isisd,yang: algo cli/yang/callbacks
Define the IS-IS flex-algo structure in yang, the CLI configuration
commands and the skeletons of frontend and backend functions that are
called by the CLI code.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Eric Kinzie <ekinzie@labn.net>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:13:59 +02:00
Hiroki Shirokura
735fb37db1 lib: add library for igp flexible-algorithm
Add a library to deal with Flexible Algorithm that will be common to
IS-IS and OSPF. The functions enables to deal with:

- Affinity-maps
- Extended Admin Group (RFC7308)
- Flex-Algo structures that contains the flex-algo configurations

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:13:58 +02:00
Hiroki Shirokura
81a067cd92 lib,isisd: refactor igp-agnostic sr misc functions
SR Algorithms are independent of specific IGPs
such as IS-IS. This commit adds lib/sr to
aggregate IGP agnostic functions and constants.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-18 10:11:43 +02:00
Jafar Al-Gharaibeh
055355e104 lib, ospfd, yang: add route map set for min/max metric
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-04-18 00:48:16 -05:00
Donatas Abraitis
89618e7e5e
Merge pull request #13320 from LabNConsulting/fix-show-opdata-command
Fix show opdata command
2023-04-17 14:51:38 +03:00
Donatas Abraitis
e7fd314f06
Merge pull request #12550 from AbhishekNR/mld_join
pim6d: Implementing "ipv6 mld join"
2023-04-17 11:01:21 +03:00
Christian Hopps
e01ecbe194 lib: always check for error, don't count on dnode being NULL
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps
d249d7e0ab lib: always return valid data format for show yang command.
For JSON return `{}` for XPath return an XML comment `<!-- Not found -->`

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps
4ac51e2430 lib: fix broken "show yang operational-data" functionality
Previously was using an API that returned the root of the data tree given the
users input xpath value, and then used it like it was the leaf node (last not
first). So basically this CLI command only worked when one requested the root
node of the model.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 01:43:48 -04:00
Christian Hopps
9e0241c8fb lib: add and use new yang function for finding schema nodes
Add a wrapper around lys_find_xpath which has an unfortunate API
returning an allocated set of schema nodes when we only ever expect and
want one.

Another libyang function `lys_find_path` returns a single node; however,
that function can assert/abort on invalid path values so is unsuitable
for user input.

Replace previous uses of `lys_find_path` with new API when dealing with
possible invalid path values (i.e., from a user).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 01:43:48 -04:00
Donatas Abraitis
c9a2561444 bgpd: Implement Node Target Extended Communities
kttps://datatracker.ietf.org/doc/html/draft-ietf-idr-node-target-ext-comm

unet> sh r1 vtysh -c 'sh ip bgp nei 192.168.1.2 adver'
BGP table version is 1, local router ID is 192.168.1.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
 *> 10.10.10.10/32   0.0.0.0                  0         32768 i

Total number of prefixes 1

unet> sh r1 vtysh -c 'sh ip bgp nei 192.168.1.3 adver'
BGP table version is 1, local router ID is 192.168.1.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
 *> 10.10.10.10/32   0.0.0.0                  0         32768 i

Total number of prefixes 1

unet> sh r2 vtysh -c 'show ip bgp 10.10.10.10/32'
% Network not in table

unet> sh r3 vtysh -c 'show ip bgp 10.10.10.10/32'
BGP routing table entry for 10.10.10.10/32, version 1
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.1.1
  65001
    192.168.1.1 from 192.168.1.1 (192.168.1.1)
      Origin IGP, metric 0, valid, external, best (First path received)
      Extended Community: NT:192.168.1.3 NT:192.168.1.4
      Last update: Tue Apr 11 23:19:33 2023

unet>

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-14 21:04:40 +03:00
Philippe Guibert
c37812dd2a lib: fix handle seg6local routes on default vrf
An L3VPN network can be configured on the main BGP instance,
with an SRv6 SID. By declaring a network, a seg6local route
is created but remains invalid.

The below BGP VPN configuration the default VRF has been
used:
> router bgp 1
>  address-family ipv6 unicast
>   sid vpn export auto
>   rd vpn export 1:30
>   rt vpn both 77:77
>   import vpn
>   export vpn
>   network 2001:7::/64
>  exit-address-family

The below seg6local route has been added:

> # show ipv6 route
> [..]
> B   2001:db8:2:2:300::/128 [20/0] is directly connected, unknown inactive, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:07
>

When creating the seg6local route, an interface is used as nexthop.
The interface index is obtained from the vrf identifier. This is
true when using VRF interfaces, but is wrong when using the lo
interface which usually has the '1' ifindex whereas the vrf id for
the default VRF is 0.

Get the appropriate index from the vrf identifier.
The below seg6local route is visible:

> # show ipv6 route
> [..]
> B>* 2001:db8:1:1:300::/128 [20/0] is directly connected, lo, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:15
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-14 12:17:10 +02:00
Christian Hopps
2437ddf0b7
Merge pull request #13279 from idryzhov/if-rmap-northbound
lib: convert if_rmap config output to northbound
2023-04-13 03:50:11 -04:00
Jafar Al-Gharaibeh
dde1018745
Merge pull request #13193 from Keelan10/link_state-memory-leak
lib: link state leak fix
2023-04-12 10:57:34 -05:00
Igor Ryzhov
1d1f77b60d lib: convert if_rmap config output to northbound
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-04-12 17:17:03 +03:00
Igor Ryzhov
4150fc5399
Merge pull request #13242 from LabNConsulting/chopps/no_rip_in_lib
Convert if_rmap to use YANG northbound
2023-04-12 16:06:17 +03:00
Pushpasis Sarkar
048e1e7be8 mgmtd, lib: Cleanup zlog_err()
Cleanup all zlog_err() that were meant for debug only.

Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>
2023-04-11 22:48:52 -07:00
Jafar Al-Gharaibeh
b4ac6683ac
Merge pull request #13122 from rgirada/mgmtd_codecov
mgmtd: Fixing coverity issues and style warnings in the code
2023-04-12 00:05:56 -05:00
Christian Hopps
efa2ca6ef0 lib: convert if_rmap to YANG northbound
- nice correspondence between new YANG grouping and shared library code.
- fixes bug with RIPNG use, certainly didn't work before.
- removes rip header from shared library code
- still has uses RIP_NODE/RIPNG_NODE as required by CLI foo.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-11 15:27:05 -04:00
Christian Hopps
2eb4471114 lib: fix formatting
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-11 15:26:09 -04:00
Russ White
f26a87cd24
Merge pull request #12698 from Orange-OpenSource/isisd
Isisd/Lib: Add new printfrr format facility for Intermediate System ID
2023-04-11 09:49:01 -04:00
Donatas Abraitis
bc818f2ff5
Merge pull request #13226 from anlancs/fix/ripd-leak
ripd: Fix memory leak for ripd's route-map
2023-04-11 14:37:40 +03:00
Olivier Dugeon
9a9f0b893e lib: Update Edge Key in link_state
The original uin64_t for the edge key in link state is not always appropriate
with IPv6 addresses. In some cases, 2 different edge with 2 different IPv6
addresses could conduct to the same key. The resulting TED is wrong in this
case.

This patch replace the uint64_t edge key by a dedicated structure. The
resulting key of the edge is:
 - the local IPv4 address of the corresponding link
 - the local IPv6 address if no IPv4 address is configured on the link
 - the local + remote link ID for unnumbered address

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:25 +02:00
Keelan10
c123d2dee0 lib: Fix link state memory leak
Free link message data when a delete event is recorded.

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-04-07 11:41:21 +04:00
Donald Sharp
b589466918 *: Use a struct prefix *p instead of a struct prefix in functions
When passing a prefix into a function let's pass by address instead
of pass by value.  Let's save our stack space.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 18:00:09 -04:00
anlan_cs
d3ec0066e5 ripd: Fix memory leak for ripd's route-map
When cleaning `ripd`, it should free `ctx->name` of `struct if_rmap_ctx`,
not `ctx` itself.  Otherwise, it will lead to memory leak.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-06 21:30:08 +08:00
rgirada
83b78f43f4 mgmtd: Fixing style warnings
Description:
	Fixing the style warnings in the mgmtd code.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-04-05 10:30:24 +00:00
Donatas Abraitis
27a0311fcc
Merge pull request #13194 from Keelan10/sharpd-memory-leak
[WIP] sharpd: fix leak
2023-04-05 10:05:49 +03:00
Jafar Al-Gharaibeh
92c4494ce5
Merge pull request #13145 from donaldsharp/do_delete
Improve and fix zebra GR
2023-04-04 21:10:54 -05:00
Russ White
204e450a72
Merge pull request #13192 from anlancs/fix/ripd-wrong-routemap
ripd: Fix malformed route-map
2023-04-04 09:50:02 -04:00
Jafar Al-Gharaibeh
3b28a5ef6b
Merge pull request #13131 from LabNConsulting/chopps/no-startup-file
mgmtd: remove startup config feature for now
2023-04-04 08:42:04 -05:00
Russ White
c0656e9040
Merge pull request #12837 from donaldsharp/unlikely_routemap
Unlikely routemap
2023-04-04 08:20:25 -04:00
Keelan10
5aa36ff77b sharpd: Fix sharpd memory leak
Free path

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-04-03 17:51:48 +04:00
Abhishek N R
bd2c824a21 pim6d: Impelmenting "ipv6 mld join"
Fixes: #12014

Signed-off-by: Abhishek N R <abnr@vmware.com>
2023-04-03 04:05:17 -07:00
anlan_cs
ff0fa00c7d ripd: Fix malformed route-map
Currently the process of the `route-map` configuration for `per-vrf-rip`
is wrong.

There are two problems:
1. `ctx->name` for `if_rmap_ctx`  is not initialized in `if_rmap_ctx_create()`.
2.  The global `if_rmap_ctx_list` is wrongly used for `per-vrf-rip`.

So, two changes for it:
1. Correctly initializes `ctx->name`.
2. Use specific `if_rmap_ctx` for `per-vrf-rip`, not global one.

Note, this related implementation for `route-map` is only for `ripd`.

Before:
```
anlan(config)# route rip vrf vrf1
anlan(config-router)# route-map aa in lan
anlan(config-router)# do show run
!
router rip
 route-map aa in lan
exit
!
```

After:
```
anlan(config)# route rip vrf vrf1
anlan(config-router)# route-map aa in lan
anlan(config-router)# do show run
!
router rip vrf vrf1
 route-map aa in lan
exit
!
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-03 10:48:33 +08:00
Christian Hopps
8033bf3976 mgmtd: lib: read transitioned daemons split config files in mgmtd
When daemons transition to mgmtd they should stop reading their split config
files, and let mgmtd do that, otherwise things can get out of sync.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-01 18:06:43 -04:00
Jafar Al-Gharaibeh
277eb2e580
Merge pull request #13060 from opensourcerouting/feature/allow_peering_with_127.0.0.1
bgpd: Allow peering via 127.0.0.0/8
2023-03-31 00:14:27 -05:00
mobash-rasool
6baf6b184c
Merge pull request #12916 from donaldsharp/clang_15_warnings
freebsd 14, clang 15
2023-03-30 08:41:40 +05:30
Donald Sharp
fbdc605778 lib: Ensure the safi is set to a sensible value
The safi has no 0 value which it is set to as part of the
initialization.  Let's just set it to a sensible value.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-29 07:48:42 -04:00
Donald Sharp
2c38c794a0 lib: Remove getopt.c and getopt1.c
Why do we need getopt code that is standard in everything
that we compile against?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-28 10:07:38 -04:00
Donald Sharp
38c57f3f65 lib: Remove unneeded asserts in mgmt code
event_add_XXXX functions have no failure path where
if you pass in a double event pointer that it could
return without setting the pointer.  As such these
asserts make no sense and are unnecessary

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-27 08:08:36 -04:00
David Lamparter
be95afe196 lib/clippy: bail out on newline inside string
While C compilers will generally process strings across lines, we really
don't want that.  I rather treat this as the indication of the typo it
probably is warn about it than support this odd C edge case.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-03-25 12:34:35 +09:00
David Lamparter
9e92984f32 lib/clippy: don't SEGV on invalid tokens in DEFPY
The token value can be NULL if we run into something that failed to
parse.  Throw a Python exception rather than SEGV.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-03-25 12:33:14 +09:00
Donald Sharp
02e701e49e *: Fixup formatting issues due to reordering
All the event changes exposed a bunch of places where
we were not properly following our standards.  Just
clean them up in one big fell swoop.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:37:21 -04:00
Donald Sharp
24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
ce50d11c4d *: Convert thread_master_XXX functions to event_master_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
70d4d90c82 lib, zebra: Convert THREAD_TIMER_STRLEN to EVENT_TIMER_STRLEN
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
04ec66797c lib: change cpu_thread_history to cpu_event_history
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
5163a1c560 lib: convert xref_threadsched to xref_eventsched
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
3905fb7393 lib: convert thread internal lists to event internal lists
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
5f6eaa9b96 *: Convert a bunch of thread_XX to event_XX
Convert these functions:

thread_getrusage
thread_cmd_init
thread_consumed_time
thread_timer_to_hhmmss
thread_is_scheduled
thread_ignore_late_timer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
70c35c11f2 *: Convert thread_should_yield and thread_set_yield_time
Convert thread_should_yield and thread_set_yield_time
to event_should_yield and event_set_yield_time

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
4f830a0799 *: Convert thread_timer_remain_XXX to event_timer_remain_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
8c1186d38e *: Convert thread_execute to event_execute
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
ba7d2705d6 lib: Convert THREAD_YIELD_TIME_SLOT to EVENT_YIELD_TIME_SLOT
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp
de2754be3a *: Convert thread_fetch and thread_call to event_fetch and event_call
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00