You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, one would assume that the address returned by getaddrinfo should be directly usable by an application. This is an assumption made by the updatehub library, which I have been trying to use.
However, when using an openthread network and resolving an ipv4 address, getaddrinfo will resolve the ipv4 address. This address is unusable by the application without first converting to an ipv6 address and adding a nat64 prefix.
This means that libs that directly use getaddrinfo (like updatehub) will never successfully resolve a usable address on an openthread network. Updatehub does have an option to provide a prefixed ipv6 address instead of a hostname, but this option is not robust. Newer openthread border router implementations do not use a static nat64 prefix, instead they generate one on startup or factory reset. So predefining an address for a library like updatehub is not guaranteed to persist over time as a device joins a different network or border routers restart.
Either the implementation of getaddrinfo needs to change to account for networks with nat64, or libraries that utilize it need to be aware of lower level network details and prefix addresses accordingly.
In the updatehub case, one easy solution may be to just alter the updatehub lib to allow for users to provide a dynamic parameter to configure the library instead of a static Kconfig define for the updatehub server hostname/address.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Generally, one would assume that the address returned by getaddrinfo should be directly usable by an application. This is an assumption made by the updatehub library, which I have been trying to use.
However, when using an openthread network and resolving an ipv4 address, getaddrinfo will resolve the ipv4 address. This address is unusable by the application without first converting to an ipv6 address and adding a nat64 prefix.
This means that libs that directly use getaddrinfo (like updatehub) will never successfully resolve a usable address on an openthread network. Updatehub does have an option to provide a prefixed ipv6 address instead of a hostname, but this option is not robust. Newer openthread border router implementations do not use a static nat64 prefix, instead they generate one on startup or factory reset. So predefining an address for a library like updatehub is not guaranteed to persist over time as a device joins a different network or border routers restart.
Either the implementation of getaddrinfo needs to change to account for networks with nat64, or libraries that utilize it need to be aware of lower level network details and prefix addresses accordingly.
In the updatehub case, one easy solution may be to just alter the updatehub lib to allow for users to provide a dynamic parameter to configure the library instead of a static Kconfig define for the updatehub server hostname/address.
Beta Was this translation helpful? Give feedback.
All reactions