Commit Graph

32667 Commits

Author SHA1 Message Date
Pooja Jagadeesh Doijode
e25a0b138a zebra: Install directly connected route after interface flap
Issue:
After vlan flap, zebra was not marking the selected/best route as installed.

As a result, when a static route was configured with nexthop as directly
connected interface's(vlan) IP, the static route was not being installed
in the kernel since its nexthop was unresolved. The nexthop was marked
unresolved because zebra failed to mark the best route as installed after
interface flap.

This was happening because, in dplane_route_update_internal() if the old and
new context type, and nexthop group id are the same, then zebra doesn't send
down a route replace request to kernel. But, the installed (ROUTE_ENTRY_INSTALLED)
flag is set when zebra receives a response from kernel. Since the
request to kernel was being skipped for the route entry, installed flag
was not being set

Fix:
In dplane_route_update_internal() if the old and new context type, and
nexthop group id are the same, then before returning, installed flag will
be set on the route-entry if it's not set already.

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-04-10 16:03:23 -07:00
Donald Sharp
746e0522f3 bgpd: Do not allow a no router bgp XXX when autoimport is happening
When we have these sequence of events causing a crash in
evpn_type5_test_topo1:

(A) no router bgp vrf RED 100
   this schedules for deletion the vrf RED instance
(B) a l3vni change event from zebra
   this creates a bgp instance for VRF RED in some cases
   additionally it auto imports evpn routes into VRF RED
   Please note this is desired behavior to allow for the
   auto importation of evpn vrf routes
(C) no router bgp 100
   The code was allowing the deletion of the default
   instance and causing tests to crash.

Effectively the test in bgp_vty to allow/dissallow
the removal of the default instance was not correct
for the case when (B) happens.

Let's just not allow the command to succeed in this case as that
the test was wrong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-10 14:14:01 -04:00
Donald Sharp
5a7c43c77e bgpd: Do not allow l3vni changes when shutting down
When a `no router bgp XXX` is issued and the bgp instance
is in the process of shutting down, do not allow a l3vni
change coming up from zebra to do anything.  We can just
safely ignore it at this point in time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-10 14:14:01 -04:00
Donald Sharp
ef96e3753f bgpd: Use the actual pointer type instead of a void
Let's cut to the chase, we know the pointer type and
it allows us to not to some gyrations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-10 14:14:01 -04:00
Jafar Al-Gharaibeh
8b985768bf
Merge pull request #13239 from opensourcerouting/fix/enable_scripting_for_docker_alpine_build
docker: Fix --enable-scripting for Docker images
2023-04-10 11:29:20 -05:00
anlan_cs
b769fdc88b ripd: Simplify code for distance
Simplify the code for `rip_distance_apply()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-10 15:53:07 +08:00
Sarita Patra
8b462d5579 pimd: Process no-forward BSM packet
Topology Used:
=============
Cisco---FRR4----FRR2

Initially PIM nbr is down between FRR4----FRR2 from FRR2 side
Cisco is sending BSR packet to FRR4.

Problem Statement:
=================
No shutdown the PIM neighbor on FRR2 towards FRR4.
FRR2, receives BSR packet immediately as the new neighbor
comes up. This BSR packet is having no-forward bit set.
FRR2 is not able to process the BSR packet, and drop the
BSR packet.

Root Cause:
==========
When PIMD comes up, we start BSM timer for 60 seconds.
Here, the value accept_nofwd_bsm is setting to false.

FRR2, when receives no-forward BSR packet, it is getting
accept_nofwd_bsm value as false.

So, it drops, the no-forward BSM packet.

Fix:
===
Set accept_nofwd_bsm as false after first BSM packet received.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-04-09 22:30:44 -07:00
anlan_cs
fa9307852e ripd: Correct one debug log
Correct one debug log, which wrongly mixed address and port.

Before:
```
ripd[469497]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0)
ripd[469497]: [VEJY5-67P5X] SEND to 224.0.0.9520
```
After:
```
ripd[471330]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0)
ripd[471330]: [T8DFR-P09JH] SEND to 224.0.0.9 port 520
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-10 11:11:30 +08:00
Chirag Shah
c683b7baad bgpd:evpn-mh esi not active suppress ead-es route
update_type1_routes_for_evi() is called from
L3VNI/L2VNI up event, if ESI is not UP then
do not advertise EAD-ES Type-1 route.
Just like from multiple places EAD-ES route
origination checks for its oper status.

Ticket:#3413454
Issue:3413454

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-04-08 13:36:16 -07:00
Donatas Abraitis
897bb1675e tests: Copy script1.lua for make dist
This is needed for `make dist` when building Docker images with Lua support.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-08 21:04:07 +03:00
Donatas Abraitis
9ad0c2f6b4 docker: Enable Lua (scripting) for Alpine images
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-08 21:04:07 +03:00
Donatas Abraitis
74675f8d44 build: Take LUA_LIBS from pkg-config
Alpine Linux has LUA_LIB with a broken path, let's use pkg-config to grab
the LUA_LIBS properly.

checking for library containing lua_load... no
configure: error: Lua 5.3 libraries are required to build with Lua support. No other version is supported.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-08 21:04:06 +03:00
Donald Sharp
48055cc48e
Merge pull request #13237 from LabNConsulting/chopps/fixriptest
tests: fix cause of intermittent failure
2023-04-08 09:23:22 -04:00
Christian Hopps
8d6765aa6d tests: fix cause of intermittent failure
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-08 04:03:11 +00:00
Mark Stapp
a63fecfb56 ospf,ospf6: fix json key typo supoort
Fix json key 'supoort' -> 'support'; add 1-year deprecation
notice; fix topotests to use corrected json key.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:19:01 -04:00
Mark Stapp
c42ac5f64b tests: replace deprecated ospf json keys
Replace many deprecated json keys in topotests after removing
those keys from ospfd.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:17:59 -04:00
Mark Stapp
f5419bf927 ospfd: remove deprecated json attrs for neighbor show
The date for removing some deprecated json attributes from
'show neighbor' has arrived, so remove the attrs (and the
CPP_NOTICE block).

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-07 16:17:59 -04:00
Jafar Al-Gharaibeh
d5243675f2
Merge pull request #13109 from LabNConsulting/topotest-cleanup
minor topotest cleanup
2023-04-07 14:45:33 -05:00
Igor Ryzhov
083369e16a
Merge pull request #13228 from LabNConsulting/chopps/json-via-yang
Update ripd YANG operational state (ECMP routes)
2023-04-07 17:56:54 +03:00
Olivier Dugeon
c62067c1a6 tests: Update TE topotests to follow new Edge Key
Following replacement of Edge Key type (uint64_t by new structure), this patch
updates the various TE topotests to the new Edge Key references.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Olivier Dugeon
f2dcaf3555 sharpd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the sharp_vty.c file to replace the old uint64_t edge key by
the new ls_edge_key structure when searching for an edge.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Olivier Dugeon
7f2742b657 pathd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the path_ted.c file to replace the old uint64_t edge key by
the new ls_edge_key structure when searching for an edge.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Olivier Dugeon
7564fcb8f9 isisd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the isis_te.c file to replace the old uint64_t edge key by
the new ls_edge_key structure.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:26 +02:00
Olivier Dugeon
dad17a2195 ospfd: Update TE to new Link State Edge key
Following the modification of the edge key in link state database
this patch updates the ospf_te.c file to replace the old uint64_t edge key by
the new ls_edge_key structure. For ospf, only IPv4 address is take into
account.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-07 16:40:25 +02: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
Donatas Abraitis
83c78d54c2 tests: Check if RIP allow-ecmp command works correctly
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 04:21:25 -04:00
Christian Hopps
7fd2ffb96c ripd: implement new YANG operational state
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 04:21:17 -04:00
Christian Hopps
0b7f0e3548 ripd: yang: extend nexthops functionality in YANG model - skeleton
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 04:20:51 -04: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
Donatas Abraitis
0633fb7856
Merge pull request #13162 from donaldsharp/pass_by_value_no_no_no
*: Use a `struct prefix *p` instead of a `struct prefix` in functions
2023-04-07 10:19:09 +03:00
Donatas Abraitis
9261fbdc6e
Merge pull request #13222 from donaldsharp/limit_scope
Limit scope
2023-04-07 10:14:54 +03:00
Christian Hopps
19003d6e99 tests: don't warn with expected results
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:58:15 +00:00
Christian Hopps
fa773d1109 tests: initialize parent test namespace too
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
66707495d9 tests: cleanup infra
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
cd453c23f6 tests: create 8 link, switch pairs, not 8 links on one switch
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
eb9e801f8b tests: don't flush ipv6 addresses
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07 05:56:12 +00:00
Christian Hopps
01bdc91ef5 yang: fix YANG lint
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-06 21:47:20 -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
Donald Sharp
aa056a2a64 bgpd: Treat withdraw variable as a bool
Used as a bool, treated as a bool.  Make it a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 17:41:32 -04:00
Mark Stapp
6e6e1020dd ospfd: support configuration of socket buffer sizes
Add configurable socket send and receive buffer sizes,
configured at the instance level.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-06 14:16:43 -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
Donald Sharp
cfd04dcb3e bgpd: Limit flowspec to no attribute means a implicit withdrawal
All other parsing functions done from bgp_nlri_parse() assume
no attributes == an implicit withdrawal.  Let's move
bgp_nlri_parse_flowspec() into the same alignment.

Reported-by: Matteo Memelli <mmemelli@amazon.it>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 07:13:30 -04:00
Donald Sharp
78745b8700 bgpd: Conform bgp_packet.h with coding standards
FRR's standards state that function declarations should
have actual variable names for parameters passed in.
Let's make this so for bgp_packet.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-06 07:13:29 -04:00
Donatas Abraitis
cf35e49354
Merge pull request #13214 from chiragshah6/fdev2
zebra:return empty dict in json when evpn is disabled
2023-04-06 12:48:52 +03:00
Jafar Al-Gharaibeh
02619b5522
Merge pull request #13220 from mjstapp/fix_zebra_gr_client
zebra: null-check client pointer during GR processing
2023-04-05 22:53:00 -05:00
Mark Stapp
27552b48ab zebra: null-check client pointer during GR processing
Add a null check.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-05 12:30:52 -04: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
rgirada
93d4e355d8 mgmtd: Fixing code coverity issues in mgmtd
Description:
	the following list of coverity issues seen in mgmtd code.
	1. CID 1536832:  Memory - corruptions  (OVERLAPPING_COPY)
	   /mgmtd/mgmt_history.c: 85 in mgmt_history_create_cmt_rec()
	2. CID 1536831:  Error handling issues  (NEGATIVE_RETURNS)
	   /mgmtd/mgmt_be_server.c: 123 in mgmt_be_server_start()
	3. CID 1536830:  Resource leaks  (RESOURCE_LEAK)
	   /mgmtd/mgmt_history.c: 146 in mgmt_history_read_cmt_record_index()
	4. CID 1536829:  Error handling issues  (NEGATIVE_RETURNS)
	   /mgmtd/mgmt_fe_server.c: 123 in mgmt_fe_server_start()
	5. CID 1536828:  Possible Control flow issues  (DEADCODE)
	   /mgmtd/mgmt_txn.c: 1859 in mgmt_txn_get_config()
	6. CID 1536827:  Null pointer dereferences  (NULL_RETURNS)
           /mgmtd/mgmt_ds.c: 526 in mgmt_ds_delete_data_nodes()

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-04-05 10:29:14 +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
Sindhu Parvathi Gopinathan
61f3a6c353 zebra:return empty dict when evpn is disabled
"show evpn json" returns nothing when evpn is disabled.

Code has been fixed to return {} when evpn is disabled or no entry
available.

Before Fix:-
```
cumulus@r2:mgmt:~$ sudo vtysh -c "show evpn json"
cumulus@r2:mgmt:~$
```

After Fix:-
```
cumulus@r1:mgmt:~$ sudo vtysh -c "show evpn json"
{
}
cumulus@r1:mgmt:~$
```

Ticket:#3417955

Issue:3417955

Testing: UT done

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
2023-04-04 19:41:25 -07:00