receivedata.c: In function ‘receivedata’:
receivedata.c:66: warning: comparison between signed and unsigned
Macro ISINVALID needs to be defined via INVALID_SOCKET on all WIN32 targets, not only for MSVC.
receivedata.c: In function ‘receivedata’:
receivedata.c:35:41: warning: unused parameter ‘scope_id’ [-Wunused-parameter]
int timeout, unsigned int * scope_id)
~~~~~~~~~~~~~~~^~~~~~~~
When struct ip_mreqn is passed to IP_MULTICAST_IF setsockopt option it is
always required to set also ipv4 source address. Otherwise Linux kernel
will choose default system multicast ipv4 address which does not have to
belong to chosen interface specified in struct ip_mreqn.
Therefore on system with more multicast interfaces and more ipv4 addresses,
it may happen that interface chosen by upnpc -m option would use ipv4
address which does not belong to this interface.
This change is fixing above issue and ensure that if interface is chosen by
upnpc -m option then source address which belongs to this interface would
be used.
Without this change upnpc -m eth1 can send multicast traffic over interface
eth1 but with source ipv4 address of interface eth0, which obviously would
be rejected by upnp gateway.
miniupnpc::miniupnpc becomes an ALIAS for the shared library, if
available, and the static library otherwise.
Users of the installed library can use MINIUPNPC_USE_STATIC_LIBS to
force the use of the static library.
GetBestInterfaceEx() is not supported by older i586-mingw32msvc-gcc
compiler. GetBestInterface() works only with IPv4 addresses but in this
case it is enough as it is needed only for IP address 223.255.255.255.
Older version of i586-mingw32msvc-gcc compiler does not define
_WIN32_WINNT_VISTA macro. Therefore preprocessor #if condition is
incorrectly evaluated.
* Move it into separate win32_snprintf.h file to de-duplicate its
implementation from all miniupnp source files.
* Do not use this emulation with mingw32 SDK when __NO_ISOCEXT is not
defined as in this case mingw32 provides working snprintf function.
* Fix detection for mingw-w64 variants, when __NO_ISOCEXT is defined or
when older version without UCRT is used.
* Add check if _scprintf function is available. In case it is not available
just returns length of filled buffer to prevent buffer overflow.