Skip to content
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

libovsdb: fix potential duplicate addresses #2763

Merged
merged 1 commit into from
May 6, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented May 6, 2023

What type of this PR

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at c5dc560

Optimize address set operations in ovn-nb-address_set.go. Avoid redundant deduplication in update function and move it to create function.

🤖 Generated by Copilot at c5dc560

To optimize address set ops
We tweaked some functions and props
We removed dedupe
From AddressSetUpdate
And added it to AddressSetAdd tops

HOW

🤖 Generated by Copilot at c5dc560

  • Remove unnecessary deduplication of addresses slice in AddressSetUpdateAddress function (link)
  • Add deduplication of addresses slice in AddressSetAddAddress function to prevent errors and inconsistencies (link)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

  • The code changes in ovn-nb-address_set.go may cause a bug. The util.UniqString() function is called after formatting the CIDR, which means that if there are duplicate elements in the slice before formatting, they will not be removed. This can cause an error when updating the address set. It would be better to call util.UniqString() before formatting the CIDR.

@zhangzujian zhangzujian marked this pull request as ready for review May 6, 2023 05:44
@zhangzujian zhangzujian requested a review from oilbeater May 6, 2023 05:44
@zhangzujian zhangzujian merged commit bf1a3d7 into kubeovn:master May 6, 2023
@zhangzujian zhangzujian deleted the fix-as branch May 6, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants