diff options
author | Leyi Rong <leyi.rong@intel.com> | 2016-07-22 18:13:51 +0800 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | 2016-08-08 20:57:17 +0000 |
commit | dcafc14162e2dd49d0ea70b80080f8c23729aef3 (patch) | |
tree | 0e2a0f5af862435695a793dae3cbe6c871aeae0f /net | |
parent | a7362cf77fb26be0046da2f1080cfee0d185a91d (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ip/net_context.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ip/net_context.c b/net/ip/net_context.c index 3c4517c7b..7a51a6281 100644 --- a/net/ip/net_context.c +++ b/net/ip/net_context.c @@ -157,7 +157,7 @@ struct net_context *net_context_get(enum ip_protocol ip_proto, sizeof(struct in6_addr)); } #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); } #endif |