BNetworkInterfaceAddress needs to store auto-configuration flags

as IPV6 support was never properly or completely implemented AFAIK, you would probably be wise to examine the freebsd implementations for information.

These tickets need to be resolved to implement IPV6 support:

https://dev.haiku-os.org/query?status=!closed&component=Network+%26+Internet%2FIPv6

https://dev.haiku-os.org/ticket/7228

https://dev.haiku-os.org/ticket/8319

https://dev.haiku-os.org/ticket/11862

2 Likes

This project can serve as references and ideas:

2 Likes

This book helps a lot in implementing IPV6:
https://www.amazon.com/Protocols-Implementation-Kaufmann-Networking-English-ebook/dp/B006OLTWOY

2 Likes

Ok.thanks for the suggestion .

1 Like

Yes, I would like to resolve them one by one . 7228 is the one I am focussing on . @marcoapc

1 Like

@PulkoMandy @SCollins @marcoapc I wish to share an idea regarding this . I see that in if.h header file, we already have two auto-config flags defined, one for the interface and another for interface alias . The one for the interface , named IFF_AUTO_CONFIGURED with a value of 0x2000 is already being used for ipv4 , the one for the interface alias , named IFAF_AUTO_CONFIGURED with a value of 0x0001 , can then be used to determine if ipv6 is auto-configured or not . Apparently , this idea seems like can solve our current problem of having two different modes for two different ip addresses simultaneously . Any thoughts about this ?

1 Like

There is currently no auto configuration support for IPv6, but static IPv6 configuration should work.

To me the issue seems to be that ā€œInterfaceAddressView.cppā€ looks at that interface-level auto-configured flag instead of just relying on the mode field (so at the moment if you have a statically configured IPv6, but use DHCP for IPv4, then it also shows IPv6 as ā€œAutomaticā€).

For the time being Iā€™d make sure that IFF_AUTO_CONFIGURED is only used for IPv4 (it seems itā€™s really only being used for a tiny bit of convenience with DHCP), but wouldnā€™t introduce a flag for IPv6 until it becomes clear that there actually is a need for one (or whatever information needs to be kept for IPv6) - at that point the IPv4 flag can also be revisited.

How about this idea ? I see that in if.h header file, we already have two auto-config flags defined, one for the interface and another for interface alias . The one for the interface , named IFF_AUTO_CONFIGURED with a value of 0x2000 is already being used for ipv4 , the one for the interface alias , named IFAF_AUTO_CONFIGURED with a value of 0x0001 , can then be used to determine if ipv6 is auto-configured or not . Apparently , this idea seems like can solve our current problem of having two different modes for two different ip addresses simultaneously . Any input on this ? @cmeerw

My second post was in reply to that idea. I donā€™t think it makes sense to introduce (or repurpose) a flag thatā€™s not being used and where itā€™s not clear what use it would serve.

BNetworkInterfaceAddressSettings already has an auto_config flag that should be sufficient for now?

hi @cmeerw , as I understand from the codebase, address properties like address value, netmask, broadcast address ,flags needs to be stored somewhere permanently , so a class variable will not help in this case. Letā€™s say, i configure the ipv4 as static and ipv6 as automatic through the NetworkStatusManager app and then close it. Next time, when I again open the app, it should show the last configuration for each of these address . So , for the app to remember the last state, it needs to store somewhere the last configuration for these addresses in secondery memory .
Now when we read the data for flags from the disk, we need to separately extract the info whether ipv4 is automatic/static , ipv6 is auto/static. For this , I feel we need two different flags , IFF_AUTO_CONFIGURED , IFAF_AUTO_CONFIGURED . May be I am missing something here ?

The settings from BNetworkInterfaceAddressSettings are stored in /system/settings/network/interfaces

I suggest you do tests and apply ideas into practice, this way you will get results or errors!

Start prototyping code, make lots of revisions, fail fast and hard. This will quickly weed out the bad ideas. Hereā€™s some solid advice i got from fellow engineering peeps over the years.

  1. Donā€™t fear throwing away work
  2. Donā€™t over invest in unproven solutions
  3. Donā€™t overthink prototyping
  4. Donā€™t worry about perfection in prototypes
  5. Donā€™t spend time preplanning to excess
  6. Move fast in the design phase, the eraser is cheap, tooling is expensive.

So Iā€™d suggest try a bunch of strategies and write some code, wordt that happens it you delete it.

3 Likes

yeah, sure already implemented the ideaā€¦some fine tuning I am doing now .

1 Like

@SCollins @cmeerw @marcoapc @PulkoMandy I tested out my idea of using the interface alias flags for ipv6 auto-config check . I had to modify the flag values as the ones existing coincide with some flags for the interface itself . I observe the idea to be working perfectly fine .
I am trying to test the alternative suggestion by @cmeerw now .

1 Like

Experiment with the possibilities and apply the best solutions.

How does that persist the auto-config flag across reboots?

@cmeerw I set the corresponding flags for auto-config and those flags get set using ioctl calls , through the SetFlags method of BnetworkInterface class .