net: lwm2m: Cleanup special handling of DNS for offloading
With `CONFIG_NET_NATIVE`, offloaded drivers can specify capabilites with `NET_IPV4/6` configs, so there is no longer need to handle socket offloading separately. Also, initialize hints structure with zeros, as according to man pages unused fields should be set to 0: `All the other fields in the structure pointed to by hints must contain either 0 or a NULL pointer, as appropriate.` Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
000226ff54
commit
399f213227
1 changed files with 1 additions and 4 deletions
|
@ -4203,7 +4203,7 @@ int lwm2m_parse_peerinfo(char *url, struct sockaddr *addr, bool *use_dtls)
|
||||||
{
|
{
|
||||||
struct http_parser_url parser;
|
struct http_parser_url parser;
|
||||||
#if defined(CONFIG_LWM2M_DNS_SUPPORT)
|
#if defined(CONFIG_LWM2M_DNS_SUPPORT)
|
||||||
struct addrinfo hints, *res;
|
struct addrinfo *res, hints = { 0 };
|
||||||
#endif
|
#endif
|
||||||
int ret;
|
int ret;
|
||||||
u16_t off, len;
|
u16_t off, len;
|
||||||
|
@ -4270,9 +4270,6 @@ int lwm2m_parse_peerinfo(char *url, struct sockaddr *addr, bool *use_dtls)
|
||||||
hints.ai_family = AF_INET6;
|
hints.ai_family = AF_INET6;
|
||||||
#elif defined(CONFIG_NET_IPV4)
|
#elif defined(CONFIG_NET_IPV4)
|
||||||
hints.ai_family = AF_INET;
|
hints.ai_family = AF_INET;
|
||||||
#elif defined(CONFIG_NET_SOCKETS_OFFLOAD)
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
|
||||||
hints.ai_family = AF_INET;
|
|
||||||
#else
|
#else
|
||||||
hints.ai_family = AF_UNSPEC;
|
hints.ai_family = AF_UNSPEC;
|
||||||
#endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */
|
#endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue