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
bz
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.

kevans added a reviewer: bz.May 5 2020, 5:56 AM
kevans added a subscriber: kevans.

Adding bz@ for IPv6 relevance; also ping6 for melifaro@ in case this now clashes with recent routing changes.

Adding bz@ for IPv6 relevance; also ping6 for melifaro@ in case this now clashes with recent routing changes.

No, it's ortogonal.
I'll take a look into that review a day or two, as I said in the list.

emaste added a subscriber: emaste.May 6 2020, 3:46 PM

Generally looking good, though my primary concern is interaction with the existing applications.

Both bird and frr ignore value of ifam_flags.

Will update the patch and look at the behaviour for both of them.

Generally looking good, though my primary concern is interaction with the existing applications.

Both bird and frr ignore value of ifam_flags.

Will update the patch and look at the behaviour for both of them.

ifam_flags is the interface flags so it makes sense to ignore it :)
This patch just enables the application to then ioctl SIOCGIFAFLAG_IN6 to get the state of the address when the address updates rather than polling perdiodically.

To really make this work we need ifam_addrflags ..... and ideally ifam_pid to identify the sender.
https://netbsd.gw.com/cgi-bin/man-cgi?route+4+NetBSD-current