Closed Foxi352 closed 1 year ago
Until releasing this enhancement, we should improve get_local_ipv6_address
in lib/utils.py
See this thread upon IP6 on Raspi disabled as error source. @Foxi352 Maybe you can incorporate some error handling here...
Will see what i can do. I am currently in Rome until end of the week, so it may take up to the next weekend.
@Foxi352 provided a fix but as long as there is no one really using SmartHomeNG with IP6 we won't be able to test nor provide fixes.
While working on lib.network I tried some of the IPv6 code.
If we can do away with strict format checking for hostname, ipv4 or ipv6 format, this get a lot easier, as most of Pythons own functions (especially socket and asyncio) don't much care about ipv4 or ipv6 and numeric or host. Especially socket is very argument-friendly, just feed it anything and it tries its best to get on with it.
Parameter checking is fine for detecting erroneously created plugin or item configuration, but it would have to be more open.
Before I put more work in rewritten check functions, I'd like a consensus or decision on which aspects to put focus on.
Basically, lib.network and the network plugin (and most plugins not using "excessive" (sorry) parameter checking) are fine with ipv6 (as long as the os side doesn't have any bugs...)
There are a lot of plugins that expect IPv4 addresses. All those plugins have to be checket and possibly modified. So probably a milestone beyond v1.9 is more reasonable.
The main question for me is: How many users are going to have a local network based on IPv6 in the near future. That could help to decide if a complete IPv6 compatibility is needed in the near future.
Just as a side note:
if the plugin doesn't explicitly check for ipv4 and just hands off the "address" to socks or requests or asyncio, IPv6 works well. Almost every "base" python function expecting a "host" parameter can take ipv4, ipv6 or hostname without problems. So if the plugin doesn't care what type of "host" it is passing on, everything is easy.
But I agree - specifically implementing IPv6 (where absolutely needed, see above) should only be done if a real need for IPv6 is there. I don't see it at the moment.
As this has been dormant and I can not see either progress nor need, I'll close this for now. Can be reopened if getting relevant again.
This issue is to collect work done to move SHNG forward to support IPv6.