Page MenuHomeFreeBSD

Announce INET6 address flag changes to userland
Needs ReviewPublic

Authored by roy_marples.name on Feb 27 2016, 2:30 AM.

Details

Reviewers
melifaro
hrs
Group Reviewers
network

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

roy_marples.name retitled this revision from to Announce INET6 address flag changes to userland.
roy_marples.name updated this object.
roy_marples.name edited the test plan for this revision. (Show Details)
roy_marples.name set the repository for this revision to rS FreeBSD src repository.
hrs added a reviewer: hrs.Jul 11 2016, 8:44 PM
ae added a reviewer: melifaro.Jul 11 2016, 9:27 PM
hrs edited edge metadata.Jul 12 2016, 12:09 AM

Looks reasonable to add notification when ia6_flags is changed, but why is RTM_ADD used instead of RTM_CHANGE? rt_addrmsg() is for addition/removal of an address and RTM_ADD is translated to RTM_NEWADDR there.

dab added a subscriber: dab.Jul 12 2016, 3:12 AM
In D5469#149446, @hrs wrote:

Looks reasonable to add notification when ia6_flags is changed, but why is RTM_ADD used instead of RTM_CHANGE? rt_addrmsg() is for addition/removal of an address and RTM_ADD is translated to RTM_NEWADDR there.

Because rt_addrmsg() will change address announcements to RTM_DELADDR if not RTM_ADD. FreeBSD does not support RTM_CHGADDR so change doesn't really fit either. It can also be argued that the address itself, nor route, are actually changing, just the state of it.

For what its worth, NetBSD and Linux also use the same flags for this - RTM_NEWADDR or equivalent.

Let me clarify.

BSD uses rt_addrmsg() to announce new and deleted addresses.
It makes perfect sense to use the same function to announce address change states, such as for changes ia6_flags.
Because FreeBSD only has RTM_NEWADDR and RTM_DELADDR we need to use RTM_NEWADDR and the function arguments then dictate that we need to use RTM_ADD.

The alternative is to write a new function which doesn't take a route argument and thus can accept RTM_NEWADDR directly, but I thought that would be too much overhead for little gain.