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.
Option listen= is used for LAN interface/address and option ext_addr= is
used for public IP address. If users by mistake swap WAN and LAN interface
or public and private IP addresses then miniupnpd obviously would not work
and instead of hacking miniupnpd code users should rather check their
miniupnpd configuration or local firewall settings.
So add checks and hints which prevents security issues like swapping LAN
and WAN interfaces/addresses and therefore prevent exposing port forwarding
and firewall configuration on public Internet.
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.