Skip to content

Commit 2314091

Browse files
JacobTanenbaumalmusil
authored andcommitted
northd: Fix Crash when deleting ports with BFD session.
When deleting ports with BFD sessions without removing the BFD northbound object northd will crash after recompute because the southbound BFD object does get removed when all ports are deleted. Fix by checking for the southbound objects existence for stale BFD entries before attempting to delete them. Reported-at: https://redhat.atlassian.net/browse/FDP-4218 Fixes: 15c9c9f ("northd: Add bfd, static_routes, route_policies and bfd_sync nodes to I-P engine.") Signed-off-by: Jacob Tanenbaum <jtanenba@redhat.com> Signed-off-by: Ales Musil <amusil@redhat.com> (cherry picked from commit 0f75487)
1 parent 2a5c6b5 commit 2314091

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

northd/northd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10757,7 +10757,7 @@ bfd_table_sync(struct ovsdb_idl_txn *ovnsb_txn,
1075710757
}
1075810758

1075910759
HMAP_FOR_EACH_POP (bfd_e, hmap_node, &sync_bfd_connections) {
10760-
if (bfd_e->stale) {
10760+
if (bfd_e->stale && bfd_e->sb_bt) {
1076110761
sbrec_bfd_delete(bfd_e->sb_bt);
1076210762
}
1076310763
bfd_erase_entry(bfd_e);

tests/ovn-northd.at

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4167,6 +4167,11 @@ check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats
41674167
bfd_route_policy_uuid=$(fetch_column nb:bfd _uuid logical_port=r0-sw9)
41684168
AT_CHECK([ovn-nbctl list logical_router_policy | sed s/,//g | grep -q "$bfd_route_policy_uuid"])
41694169

4170+
# Check that the logical router port can be deleted and the bfd
4171+
# recompute does not crash northd.
4172+
check ovn-nbctl --wait=sb lrp-del r0-sw2
4173+
check ovn-nbctl --wait=sb sync
4174+
41704175
OVN_CLEANUP_NORTHD
41714176
AT_CLEANUP
41724177
])

0 commit comments

Comments
 (0)