If logical router has ECMP for a same prefix, northd tries to
adversited N times by the same logical router port, insert in
sbrec_advertised_route table fails because all fields of
sbrec_advertised_route are equal.
To fix it, just add one time the route to be advertised in the
sync routes.
Fixes: f2deb24c5c43 ("northd: Sync Advertised_Route to sb.")
Signed-off-by: Lucas Vargas Dias <[email protected]>
---
northd/en-advertised-route-sync.c | 11 ++++++++++-
tests/ovn-northd.at | 9 +++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/northd/en-advertised-route-sync.c
b/northd/en-advertised-route-sync.c
index 35def9d22..3dd4d0581 100644
--- a/northd/en-advertised-route-sync.c
+++ b/northd/en-advertised-route-sync.c
@@ -757,8 +757,17 @@ advertised_route_table_sync(
advertise_route_track_od(data, route->od, route->tracked_port,
route->source);
+ const struct sbrec_port_binding *tracked_port =
+ route->tracked_port ? route->tracked_port->sb : NULL;
+ char *ip_prefix = normalize_v46_prefix(&route->prefix, route->plen);
+ if (ar_entry_find(&sync_routes,route->od->sdp->sb_dp,
+ route->out_port->sb, ip_prefix,
+ tracked_port)) {
+ free(ip_prefix);
+ continue;
+ }
ar_entry_add_nocopy(&sync_routes, route->od, route->out_port,
- normalize_v46_prefix(&route->prefix, route->plen),
+ ip_prefix,
route->tracked_port,
route->source);
}
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index c9e998129..cae20aa1a 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -15095,6 +15095,15 @@ check_row_count Advertised_Route 3
check_row_count Advertised_Route 2 logical_port=$pb
check_row_count Advertised_Route 1 logical_port=$pb ip_prefix=192.168.0.0/24
+# Adding two statics routes adds none additional entry.
+check ovn-nbctl --wait=sb lr-route-del lr0 192.168.0.0/24 10.0.0.10
+check ovn-nbctl --wait=sb --ecmp lr-route-add lr0 192.168.0.0/24 10.0.0.10
+check ovn-nbctl --wait=sb --ecmp lr-route-add lr0 192.168.0.0/24 10.0.0.11
+
+check_row_count Advertised_Route 3
+check_row_count Advertised_Route 2 logical_port=$pb
+check_row_count Advertised_Route 1 logical_port=$pb ip_prefix=192.168.0.0/24
+
# Adding an ipv6 LRP adds an addition route entry.
check ovn-nbctl --wait=sb lrp-add lr0 lr0-sw2 00:00:00:00:ff:03 2001:db8::1/64
fe80::1/64
pb3=$(fetch_column port_binding _uuid logical_port=lr0-sw2)
--
2.34.1
--
_'Esta mensagem é direcionada apenas para os endereços constantes no
cabeçalho inicial. Se você não está listado nos endereços constantes no
cabeçalho, pedimos-lhe que desconsidere completamente o conteúdo dessa
mensagem e cuja cópia, encaminhamento e/ou execução das ações citadas estão
imediatamente anuladas e proibidas'._
* **'Apesar do Magazine Luiza tomar
todas as precauções razoáveis para assegurar que nenhum vírus esteja
presente nesse e-mail, a empresa não poderá aceitar a responsabilidade por
quaisquer perdas ou danos causados por esse e-mail ou por seus anexos'.*
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev