Skip to content

Commit 399f213

Browse files
rlubosjukkar
authored andcommitted
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 <[email protected]>
1 parent 000226f commit 399f213

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

subsys/net/lib/lwm2m/lwm2m_engine.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4203,7 +4203,7 @@ int lwm2m_parse_peerinfo(char *url, struct sockaddr *addr, bool *use_dtls)
42034203
{
42044204
struct http_parser_url parser;
42054205
#if defined(CONFIG_LWM2M_DNS_SUPPORT)
4206-
struct addrinfo hints, *res;
4206+
struct addrinfo *res, hints = { 0 };
42074207
#endif
42084208
int ret;
42094209
u16_t off, len;
@@ -4270,9 +4270,6 @@ int lwm2m_parse_peerinfo(char *url, struct sockaddr *addr, bool *use_dtls)
42704270
hints.ai_family = AF_INET6;
42714271
#elif defined(CONFIG_NET_IPV4)
42724272
hints.ai_family = AF_INET;
4273-
#elif defined(CONFIG_NET_SOCKETS_OFFLOAD)
4274-
memset(&hints, 0, sizeof(hints));
4275-
hints.ai_family = AF_INET;
42764273
#else
42774274
hints.ai_family = AF_UNSPEC;
42784275
#endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */

0 commit comments

Comments
 (0)