Skip to content

Conversation

@WeidiDeng
Copy link
Contributor

Another go at fixing 329.

According to comment, broadcast address auto-calculation is now a feature, and there is no intention to revert that. However, sometimes users do not want broadcast to be enabled.

Currently this can be done by setting Broadcast to net.IPv4zero. But that's not a public api of the netlink. And in my test, it will cause an error to be generated in the kernel log like attribute type 4 has an invalid length..

I think we can use this as a special value to disable broadcast since it already works. But now we explicitly set it to nil when interacting with netlink.

This is an alternative to introducing a new function or extending the Addr struct.

@WeidiDeng
Copy link
Contributor Author

@aboch Do you have time to take a look at this change? What's your opinion?

@aboch
Copy link
Collaborator

aboch commented Dec 30, 2024

Thank you @WeidiDeng.
Deviating from iproute2 behavior is not good. We have chosen semantic versioning for this package to be able to introduce API breaking changes.

Let's do the right change, let's make the behavior of the addr add/del methods in line with iproute2 behavior.
Then we can release a 2.0 version,
WDYT?

@WeidiDeng
Copy link
Contributor Author

I think it's OK.

@WeidiDeng
Copy link
Contributor Author

@aboch I removed the comment when deleting an address since it makes no sense.

@aboch
Copy link
Collaborator

aboch commented Jan 9, 2025

Please squash the commits into one

remove comments about broadcast when deleting address

remove another comment about broadcast auto calculation
@WeidiDeng
Copy link
Contributor Author

@aboch all commits are squashed

@aboch
Copy link
Collaborator

aboch commented Jan 10, 2025

LGTM

@aboch aboch merged commit 391c850 into vishvananda:main Jan 10, 2025
2 checks passed
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