Skip to content

Conversation

@jellonek
Copy link
Contributor

Added as a separate func to not introduce an API breaking change.
Closes #471

Added as a separate func to not introduce an API breaking change.
Closes vishvananda#471
@jellonek
Copy link
Contributor Author

@vishvananda @aboch @fcrisciani PTAL
I still thing that this should be done as a breaking API change, that broadcast calculated address should be added only when requested as an option, but that would require a new release of whole library.
WDYT?

@jerryz920
Copy link

Thanks for the PR! Do you have other concerns to merge and release this one @vishvananda ?

@aboch
Copy link
Collaborator

aboch commented Jul 26, 2019

IMO, I believe it is worth investigating other approaches, trying hard to avoid adding such a specific method.

@jerryz920
Copy link

Without adding new method then it will definitely cause API semantic change. Will it make sense to not automatically add brd address on /31 or /30?

@jellonek
Copy link
Contributor Author

IMO it makes sense, but that would be breaking change. That's why I'm asking there also @vishvananda

@jellonek
Copy link
Contributor Author

@vishvananda ping

brandt added a commit to brandt/netlink that referenced this pull request Oct 30, 2019
Since [vishvananda#248](vishvananda#248), adding an address automatically sets the broadcast if the broadcast address was not specified. This is undesirable when adding an IP with a prefixlen of /31 or /32. (Additional details in the issues linked below.)

This changes the behavior so that the broadcast is only automatically set if the prefixlen is /30 or larger.

Issue reported in:

- vishvananda#329
- vishvananda#471

See also:

- [RFC 3021](http://tools.ietf.org/html/rfc3021)

Alternatives to this PR:

A. vishvananda#472 - Adds `AddrAddWithoutCalculatedBroadcast`.
B. jjastrze-ovh@9a85a61 - Breaking change to make auto-setting the broadcast address an opt-in feature.
C. <no existing PR> - Suppress sending of the broadcast to netlink when `addr` has a broadcast set to `0.0.0.0`.
brandt added a commit to brandt/netlink that referenced this pull request Oct 30, 2019
Since [vishvananda#248](vishvananda#248), adding an address automatically sets the broadcast if the broadcast address was not specified. This is undesirable when adding an IP with a prefixlen of /31 or /32. (Additional details in the issues linked below.)

This changes the behavior so that the broadcast is only automatically set if the prefixlen is /30 or larger.

Issue reported in:

- vishvananda#329
- vishvananda#471

See also:

- [RFC 3021](http://tools.ietf.org/html/rfc3021)

Alternatives to this PR:

A. vishvananda#472 - Adds `AddrAddWithoutCalculatedBroadcast`.
B. jjastrze-ovh@9a85a61 - Breaking change to make auto-setting the broadcast address an opt-in feature.
C. already works - Suppress setting the broadcast when addr's broadcast address is set to `0.0.0.0`. (This works today, but I'm not sure the behavior can be relied upon as a public API.)
@brandt
Copy link
Contributor

brandt commented Oct 30, 2019

@aboch @jellonek I just submitted PR #496 with a different approach mirroring @dannyk81's suggestion in #329 to no longer automatically set the broadcast address on subnets too small to logically have one (/32 and /31).

As I mention in #496, another alternative – one that already works today – is to set the broadcast address to net.IP{0, 0, 0, 0}. However, I don't presently know if that's part of netlink's public API or if it's a quirk that could break in the future.

@dannyk81
Copy link

thanks @brandt, at the time I was meaning to do a similar PR and... life got the best of me 😅

vishvananda pushed a commit that referenced this pull request Nov 13, 2019
Since [#248](#248), adding an address automatically sets the broadcast if the broadcast address was not specified. This is undesirable when adding an IP with a prefixlen of /31 or /32. (Additional details in the issues linked below.)

This changes the behavior so that the broadcast is only automatically set if the prefixlen is /30 or larger.

Issue reported in:

- #329
- #471

See also:

- [RFC 3021](http://tools.ietf.org/html/rfc3021)

Alternatives to this PR:

A. #472 - Adds `AddrAddWithoutCalculatedBroadcast`.
B. jjastrze-ovh@9a85a61 - Breaking change to make auto-setting the broadcast address an opt-in feature.
C. already works - Suppress setting the broadcast when addr's broadcast address is set to `0.0.0.0`. (This works today, but I'm not sure the behavior can be relied upon as a public API.)
@vishvananda
Copy link
Owner

I went ahead and merged the non-breaking change so going to close this for now. Please rebase and reopen if you think that we should also have this method.

@jellonek jellonek deleted the 471 branch January 10, 2020 12:54
gkodali-zededa pushed a commit to gkodali-zededa/netlink that referenced this pull request May 21, 2021
Since [vishvananda#248](vishvananda#248), adding an address automatically sets the broadcast if the broadcast address was not specified. This is undesirable when adding an IP with a prefixlen of /31 or /32. (Additional details in the issues linked below.)

This changes the behavior so that the broadcast is only automatically set if the prefixlen is /30 or larger.

Issue reported in:

- vishvananda#329
- vishvananda#471

See also:

- [RFC 3021](http://tools.ietf.org/html/rfc3021)

Alternatives to this PR:

A. vishvananda#472 - Adds `AddrAddWithoutCalculatedBroadcast`.
B. jjastrze-ovh@9a85a61 - Breaking change to make auto-setting the broadcast address an opt-in feature.
C. already works - Suppress setting the broadcast when addr's broadcast address is set to `0.0.0.0`. (This works today, but I'm not sure the behavior can be relied upon as a public API.)
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.

Broadcast address added to device while not explicitly requested

6 participants