Page MenuHomeFreeBSD

Announce INET6 address flag changes to userland
Needs ReviewPublic

Authored by roy_marples.name on Feb 27 2016, 2:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 14 2024, 1:18 AM
Unknown Object (File)
Feb 23 2024, 2:50 PM
Unknown Object (File)
Jan 23 2024, 8:17 PM
Unknown Object (File)
Jan 22 2024, 1:54 AM
Unknown Object (File)
Jan 22 2024, 12:18 AM
Unknown Object (File)
Jan 17 2024, 2:17 AM
Unknown Object (File)
Dec 11 2023, 9:28 AM
Unknown Object (File)
Nov 13 2023, 1:31 PM

Details

Reviewers
melifaro
hrs
bz
Group Reviewers
network

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
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 - subversion.

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.

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

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

My immediate concern was the same as @melifaro 's though I am not just thinking about 1 or 2 pieces of software, The ecosystem is more complex.
But I do agree that an "event" mechanism would be good to have and to teach user land software as well. If one enables kernel logging for nd6 and watches the startup system to stay after DAD complete is logged it is painful even after the work @cperciva has already done. That would especially help to get to remove more "sleep" calls.

In D5469#819186, @bz wrote:

My immediate concern was the same as @melifaro 's though I am not just thinking about 1 or 2 pieces of software, The ecosystem is more complex.
But I do agree that an "event" mechanism would be good to have and to teach user land software as well. If one enables kernel logging for nd6 and watches the startup system to stay after DAD complete is logged it is painful even after the work @cperciva has already done. That would especially help to get to remove more "sleep" calls.

Speaking of the route message type - RTM_CHGADDR seem to get removed from NetBSD. Though, RTM_NEWADDR looks just fine & again - that's what other OSes do already.
I'm doing something around this space at the moment, a will look/test new behaviour this week and hopefully finally merge it.