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

fix(kad): potentially incorrect return value of Addresses::remove #4816

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

stormshield-frb
Copy link
Contributor

@stormshield-frb stormshield-frb commented Nov 7, 2023

Description

Adding a check when there is only one address left in the list of Addresses to verify that the remaining one does match the provided one when calling remove.

Fixes: #4815.

Notes & open questions

N/A

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to fix this but I am not sure I understand if there is a wider impact of this behaviour or whether it is just a small thing.

The changelog entry reads as if it were a fairly serious bug which makes me curious.

protocols/kad/CHANGELOG.md Outdated Show resolved Hide resolved
protocols/kad/src/addresses.rs Outdated Show resolved Hide resolved
protocols/kad/src/addresses.rs Outdated Show resolved Hide resolved
@stormshield-frb stormshield-frb force-pushed the fix/remove-from-addresses branch 2 times, most recently from e9240bd to 3d2d68e Compare November 8, 2023 13:55
protocols/kad/src/addresses.rs Outdated Show resolved Hide resolved
protocols/kad/src/addresses.rs Outdated Show resolved Hide resolved
protocols/kad/src/addresses.rs Outdated Show resolved Hide resolved
protocols/kad/src/addresses.rs Show resolved Hide resolved
protocols/kad/CHANGELOG.md Outdated Show resolved Hide resolved
protocols/kad/CHANGELOG.md Outdated Show resolved Hide resolved
@stormshield-frb stormshield-frb force-pushed the fix/remove-from-addresses branch 4 times, most recently from 9ddb72b to 5d78918 Compare November 9, 2023 09:29
@stormshield-frb stormshield-frb force-pushed the fix/remove-from-addresses branch from 5d78918 to 8b38fbb Compare November 9, 2023 09:35
@thomaseizinger thomaseizinger changed the title fix(kad): potentially incorrect return value of Addresses::remove fix(kad): potentially incorrect return value of Addresses::remove Nov 10, 2023
Copy link
Contributor

mergify bot commented Nov 10, 2023

This pull request has merge conflicts. Could you please resolve them @stormshield-frb? 🙏

@mergify mergify bot merged commit 2b12663 into libp2p:master Nov 10, 2023
71 checks passed
@stormshield-frb stormshield-frb deleted the fix/remove-from-addresses branch November 27, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kad: potentially wrong returned value when calling Addresses::remove with a non present address
2 participants