update Changelog and comments about commit 9500253
This commit is contained in:
parent
9e042264fa
commit
5231397bd6
|
@ -1,4 +1,7 @@
|
|||
$Id: Changelog.txt,v 1.484 2022/01/23 00:14:39 nanard Exp $
|
||||
$Id: Changelog.txt,v 1.485 2022/02/19 18:58:23 nanard Exp $
|
||||
|
||||
2022/02/19:
|
||||
prefer non-reserved over reserved addresses in getifaddr()
|
||||
|
||||
VERSION 2.3.0 : released on 2022/01/23
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* $Id: getifaddr.c,v 1.26 2019/05/20 19:54:08 nanard Exp $ */
|
||||
/* $Id: getifaddr.c,v 1.28 2022/02/19 18:58:25 nanard Exp $ */
|
||||
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
||||
* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||
* (c) 2006-2019 Thomas Bernard
|
||||
* (c) 2006-2022 Thomas Bernard
|
||||
* This software is subject to the conditions detailed
|
||||
* in the LICENCE file provided within the distribution */
|
||||
|
||||
|
@ -120,6 +120,10 @@ getifaddr(const char * ifname, char * buf, int len,
|
|||
switch(ife->ifa_addr->sa_family)
|
||||
{
|
||||
case AF_INET:
|
||||
/* only consider the address if it is the 1st candidate or
|
||||
if it is not privante AND the current candidate is a private address.
|
||||
So we return a private address only if there is no public address
|
||||
on this interface */
|
||||
if(!candidate ||
|
||||
(addr_is_reserved(&((struct sockaddr_in *)candidate->ifa_addr)->sin_addr) &&
|
||||
!addr_is_reserved(&((struct sockaddr_in *)ife->ifa_addr)->sin_addr)))
|
||||
|
|
Loading…
Reference in New Issue