-
Notifications
You must be signed in to change notification settings - Fork 521
fix(ovn): add null check before sbrec delete calls #6316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| diff --git a/northd/northd.c b/northd/northd.c | ||
| index 74c47972a..6b195d475 100644 | ||
| --- a/northd/northd.c | ||
| +++ b/northd/northd.c | ||
| @@ -4950,7 +4950,9 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn, | ||
| add_op_to_northd_tracked_ports(&trk_lsps->deleted, op); | ||
| hmap_remove(&nd->ls_ports, &op->key_node); | ||
| hmap_remove(&od->ports, &op->dp_node); | ||
| - sbrec_port_binding_delete(op->sb); | ||
| + if (op->sb) { | ||
| + sbrec_port_binding_delete(op->sb); | ||
| + } | ||
|
Comment on lines
+10
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| delete_fdb_entries(ni->sbrec_fdb_by_dp_and_port, od->tunnel_key, | ||
| op->tunnel_key); | ||
| } | ||
| @@ -10702,7 +10704,7 @@ bfd_table_sync(struct ovsdb_idl_txn *ovnsb_txn, | ||
| } | ||
|
|
||
| HMAP_FOR_EACH_POP (bfd_e, hmap_node, &sync_bfd_connections) { | ||
| - if (bfd_e->stale) { | ||
| + if (bfd_e->stale && bfd_e->sb_bt) { | ||
| sbrec_bfd_delete(bfd_e->sb_bt); | ||
|
Comment on lines
+21
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| bfd_erase_entry(bfd_e); | ||
| diff --git a/utilities/ovn-sbctl.c b/utilities/ovn-sbctl.c | ||
| index b00b8cd04..2b126d52f 100644 | ||
| --- a/utilities/ovn-sbctl.c | ||
| +++ b/utilities/ovn-sbctl.c | ||
| @@ -494,7 +494,9 @@ cmd_chassis_del(struct ctl_context *ctx) | ||
| size_t i; | ||
|
|
||
| for (i = 0; i < sbctl_ch->ch_cfg->n_encaps; i++) { | ||
| - sbrec_encap_delete(sbctl_ch->ch_cfg->encaps[i]); | ||
| + if (sbctl_ch->ch_cfg->encaps[i]) { | ||
| + sbrec_encap_delete(sbctl_ch->ch_cfg->encaps[i]); | ||
| + } | ||
|
Comment on lines
+34
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| struct sbctl_chassis_private *sbctl_ch_priv; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch application for
sbrec-delete-null-check.patchis correctly added. This ensures that the critical null checks are applied during the OVN build process, preventing potential crashes.