diff --git a/subsys/net/ip/net_context.c b/subsys/net/ip/net_context.c index 53a3452c58daac..26937bd0b99974 100644 --- a/subsys/net/ip/net_context.c +++ b/subsys/net/ip/net_context.c @@ -876,7 +876,7 @@ int net_context_bind(struct net_context *context, const struct sockaddr *addr, ptr = &maddr->address.in_addr; - } else if (addr4->sin_addr.s_addr == INADDR_ANY) { + } else if (UNALIGNED_GET(&addr4->sin_addr.s_addr) == INADDR_ANY) { if (iface == NULL) { iface = net_if_ipv4_select_src_iface( &net_sin(&context->remote)->sin_addr);