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

nmcli: Treat order as significant when comparing address lists #6048

Merged

Conversation

jikamens
Copy link
Contributor

Don't sort the old and new values for ipv4.addresses and ipv6.addresses before comparing them, because order matters in these parameters: the first address specified is the default source address for outbound connections.

SUMMARY

The nmcli module (before this change) treated the order of IPv4 or IPv6 addresses for an interface as insignificant, i.e., it would not consider it a change for the order of these addresses to change. This is not correct, since the first address for an interface is the default address for outbound connections, so order matters. The change in this PR continues to treat order as insignificant for other list settings, but treats order as significant for ipv4.addresses and ipv6.addresses.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nmcli

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module net_tools new_contributor Help guide this first time contributor plugins plugin (any type) labels Feb 23, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Feb 23, 2023
@felixfontein
Copy link
Collaborator

CC @ThomasGebert

Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot removed the new_contributor Help guide this first time contributor label Feb 24, 2023
@felixfontein
Copy link
Collaborator

If nobody objects, I'll merge this this weekend.

Copy link
Contributor

@ThomasGebert ThomasGebert left a comment

Choose a reason for hiding this comment

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

lgtm

@felixfontein felixfontein merged commit 682c6fc into ansible-collections:main Feb 25, 2023
@patchback
Copy link

patchback bot commented Feb 25, 2023

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/682c6fc967ffde3c11151972f31083423e3d008c/pr-6048

Backported as #6081

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 25, 2023
* nmcli: Treat order as significant when comparing address lists

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.

* Changelog fragment for #6048

* Update changelogs/fragments/6048-nmcli-addres-order.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 682c6fc)
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Feb 25, 2023
@patchback
Copy link

patchback bot commented Feb 25, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/682c6fc967ffde3c11151972f31083423e3d008c/pr-6048

Backported as #6082

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 25, 2023
* nmcli: Treat order as significant when comparing address lists

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.

* Changelog fragment for #6048

* Update changelogs/fragments/6048-nmcli-addres-order.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 682c6fc)
@felixfontein
Copy link
Collaborator

@jikamens thanks again for your contribution!
@ThomasGebert thanks again for reviewing!

felixfontein pushed a commit that referenced this pull request Feb 25, 2023
…ant when comparing address lists (#6081)

nmcli: Treat order as significant when comparing address lists (#6048)

* nmcli: Treat order as significant when comparing address lists

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.

* Changelog fragment for #6048

* Update changelogs/fragments/6048-nmcli-addres-order.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 682c6fc)

Co-authored-by: Jonathan Kamens <jik@kamens.us>
felixfontein pushed a commit that referenced this pull request Feb 25, 2023
…ant when comparing address lists (#6082)

nmcli: Treat order as significant when comparing address lists (#6048)

* nmcli: Treat order as significant when comparing address lists

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.

* Changelog fragment for #6048

* Update changelogs/fragments/6048-nmcli-addres-order.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 682c6fc)

Co-authored-by: Jonathan Kamens <jik@kamens.us>
@github-actions
Copy link

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@jikamens
Copy link
Contributor Author

jikamens added a commit to jikamens/community.general that referenced this pull request Feb 25, 2023
…le-collections#6048)

* nmcli: Treat order as significant when comparing address lists

Don't sort the old and new values for ipv4.addresses and
ipv6.addresses before comparing them, because order matters in these
parameters: the first address specified is the default source address
for outbound connections.

* Changelog fragment for ansible-collections#6048

* Update changelogs/fragments/6048-nmcli-addres-order.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
@jikamens jikamens deleted the nmcli_address_order_significant branch February 25, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module net_tools plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants