lib_getifaddrs.c:set the last multi ipv6addr next pointer to be NULL
If the pointer is not set to zero, it will erroneously point to itself, resulting in an erroneous loop pointing Signed-off-by: wangchen <wangchen41@xiaomi.com>
This commit is contained in:
parent
4e7f323633
commit
b58eaf7bc8
1 changed files with 3 additions and 1 deletions
|
|
@ -77,7 +77,8 @@ struct myifaddrs
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NETDEV_MAX_IPv6_ADDR
|
||||
static FAR struct myifaddrs *getmutil_ipv6addr(int fd, struct lifreq *req,
|
||||
static FAR struct myifaddrs *getmutil_ipv6addr(int fd,
|
||||
FAR struct lifreq *req,
|
||||
FAR struct myifaddrs *ifaddr)
|
||||
{
|
||||
FAR struct sockaddr_in6 *ipv6addr;
|
||||
|
|
@ -129,6 +130,7 @@ static FAR struct myifaddrs *getmutil_ipv6addr(int fd, struct lifreq *req,
|
|||
ifaddr->addrs.ifa_data = (FAR struct sockaddr *)&ifaddr->hwaddr;
|
||||
}
|
||||
|
||||
ifaddr->addrs.ifa_next = NULL;
|
||||
return ifaddr;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue