The logical ports are always populated at the database level.
However, when conditional monitoring is enabled it can happen
after ovn-controller starts that we will get Advertised MAC
binding rows with LSPs that are not yet monitored. This results
in IDL setting the pointer as NULL. Which results in a crash
as we try to deref the NULL pointer:
neighbor_get_relevant_port_binding.lto_priv.0 (ovn-controller + 0x4fc8f)
en_neighbor_run.lto_priv.0 (ovn-controller + 0x87512)
engine_recompute (ovn-controller + 0xc9e20)
engine_run (ovn-controller + 0xca175)
main (ovn-controller + 0x289aa)
To prevent that skip the entries with NULL logical_port, we will
run the node again when the LSPs are actually monitored.
Fixes: 499ddafbf160 ("controller: Advertise local EVPN type2 routes in
ovn-controller.")
Reported-at: https://issues.redhat.com/browse/FDP-3100
Signed-off-by: Ales Musil <[email protected]>
---
controller/neighbor.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/controller/neighbor.c b/controller/neighbor.c
index e77b41d29..eae5eadb2 100644
--- a/controller/neighbor.c
+++ b/controller/neighbor.c
@@ -314,6 +314,13 @@ neighbor_collect_ip_mac_to_advertise(
const struct sbrec_advertised_mac_binding *adv_mb;
SBREC_ADVERTISED_MAC_BINDING_FOR_EACH_EQUAL (adv_mb, target,
n_ctx_in->sbrec_amb_by_dp) {
+ if (!adv_mb->logical_port) {
+ /* Skip the NULL logical_port, this can happen in some cases
+ * during controller startup. See
+ * https://issues.redhat.com/browse/FDP-3114 for more details. */
+ continue;
+ }
+
const struct sbrec_port_binding *pb =
neighbor_get_relevant_port_binding(n_ctx_in->sbrec_pb_by_name,
adv_mb->logical_port);
--
2.53.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev