net: net_context: Fix local ipv4 addr compare with INADDR_ANY
net_context_get will obtain ip addr from uip_hostaddr when the local ipv4 addr is set to INADDR_ANY. So local_addr->in_addr.s_addr[0] is represented for the local ipv4 addr content. Change-Id: Ie6d77f27bdde5ea8568428a61b129eccb253df0a Signed-off-by: Leyi Rong <leyi.rong@intel.com>
This commit is contained in:
parent
a7362cf77f
commit
dcafc14162
1 changed files with 1 additions and 1 deletions
|
@ -157,7 +157,7 @@ struct net_context *net_context_get(enum ip_protocol ip_proto,
|
||||||
sizeof(struct in6_addr));
|
sizeof(struct in6_addr));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (local_addr->in_addr.s_addr == INADDR_ANY) {
|
if (local_addr->in_addr.s_addr[0] == INADDR_ANY) {
|
||||||
uip_gethostaddr((uip_ipaddr_t *)&local_addr->in_addr);
|
uip_gethostaddr((uip_ipaddr_t *)&local_addr->in_addr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue