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
This project can serve as references and ideas:
This book helps a lot in implementing IPV6:
https://www.amazon.com/Protocols-Implementation-Kaufmann-Networking-English-ebook/dp/B006OLTWOY
Ok.thanks for the suggestion .
@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 ?
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.
- Donāt fear throwing away work
- Donāt over invest in unproven solutions
- Donāt overthink prototyping
- Donāt worry about perfection in prototypes
- Donāt spend time preplanning to excess
- 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.
yeah, sure already implemented the ideaā¦some fine tuning I am doing now .
@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 .
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 .