In vxlan mode with more than 2047 lrp in router, build_ports()
prints "all port tunnel ids exhausted", and frees the lrp port.

However, lsp of type "router" connected to the lrp still holds
the pointer in port->peer. This leads to northd crash in
build_lflows().

CallTrace:
  build_lswitch_rport_arp_req_flows
  build_lswitch_ip_unicast_lookup
  build_lswitch_and_lrouter_iterate_by_op
  build_lflows
  en_lflow_run
  engine_recompute
  engine_run
  inc_proc_northd_run
  main

Fixes: 3044132261d3 ("northd: Enhance implementation of port tunnel key 
requests.")
Signed-off-by: Tao Liu <[email protected]>
---
v2: clear port->peer->peer in ovn_port_destroy().
---
 northd/northd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/northd/northd.c b/northd/northd.c
index c10e5c20c..5e737bbba 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -1676,6 +1676,10 @@ ovn_port_destroy(struct hmap *ports, struct ovn_port 
*port)
          * use it. */
         hmap_remove(ports, &port->key_node);
 
+        if (port->peer) {
+            port->peer->peer = NULL;
+        }
+
         for (int i = 0; i < port->n_lsp_addrs; i++) {
             destroy_lport_addresses(&port->lsp_addrs[i]);
         }
-- 
2.31.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to