Commit Graph

541 Commits

Author SHA1 Message Date
Thomas Bernard 97b7ec1ad2
normalize use of __STDC_VERSION__ 2021-06-17 09:25:26 +02:00
fanquake 8f9ce751ba
Fix __STDC_VERSION__ check in upnpdev.h 2021-06-17 14:48:34 +08:00
Thomas Bernard 479f6ed616
miniupnpc/CMakeLists.txt: TAB => SPACES 2021-05-22 00:09:09 +02:00
past-due 2c564135e1 [CMake] Build listdevices.c as part of the listdevices executable
Do not include it in MINIUPNPC_SOURCES
2021-05-21 17:06:33 -04:00
Thomas Bernard f3c0d52ca4
wingenminiupnpcstrings.c: fix -Wsign-compare warning 2021-05-19 10:33:33 +02:00
Thomas Bernard 69acdf3356
ssdpDiscoverDevices() ignore empty string multicastif
fixes #544
2021-05-13 13:01:38 +02:00
Thomas Bernard f13a79fabc Merge branch 'apple_clock_gettime_fallback_1'
see #516
2021-05-12 00:09:48 +02:00
Thomas Bernard 56aa707a75
use C style comments 2021-05-12 00:09:28 +02:00
Thomas Bernard 0c7579c9aa
2020 => 2021 2021-05-12 00:00:06 +02:00
Pali Rohár 20ee72f9c8 miniupnpc: Show error message when GetExternalIPAddress returns empty string
According to IGD v2.0 specification GetExternalIPAddress can return also
empty string in case of error.
2021-03-28 17:33:15 +02:00
Fabio Alessandrelli 3a08dd4b89 Use GetBestInterfaceEx when available.
Since GetBestInterface is not available in UWP apps.

GetBestInterface:
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getbestinterface#requirements

GetBestInterfaceEx:
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getbestinterfaceex#requirements
2021-03-18 17:30:46 +01:00
Fabio Alessandrelli c1b64740fb Use WINVER values instead of _WIN32_WINNT_[NAME].
WINVER values are well defined, see:

https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-160
2021-03-18 17:11:48 +01:00
Thomas Bernard 81029a860b
miniupnpc: version 2.2.2 2021-03-03 00:50:51 +01:00
Thomas Bernard 200cf4cd75
miniupnpc: update Changelog.txt + 2021 2021-03-03 00:41:49 +01:00
Thomas BERNARD 94f72a63b5
Merge pull request #486 from hrydgard/fix-uwp-build
Fix Windows UWP build.
2021-02-26 15:41:11 +01:00
Thomas Bernard bfc5eab6be
fix #522 for MS VS 2010 too 2021-02-05 20:37:15 +01:00
Pali Rohár b6d8a4545b miniupnpc: Enable -W -Wstrict-prototypes compile flags also for MinGW builds 2021-01-27 13:14:33 +01:00
Pali Rohár c8883e8491 miniupnpc: Fix compile warning: comparison between signed and unsigned
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.
2021-01-27 13:12:24 +01:00
Pali Rohár d693584fdb miniupnpc: Fix compile warning: unused parameter
receivedata.c: In function ‘receivedata’:
receivedata.c:35:41: warning: unused parameter ‘scope_id’ [-Wunused-parameter]
             int timeout, unsigned int * scope_id)
                          ~~~~~~~~~~~~~~~^~~~~~~~
2021-01-27 13:10:49 +01:00
Pali Rohár e768e1555e miniupnpc: Fix compile warning: unused parameter
miniupnpc.c: In function ‘upnpDiscoverDevices’:
miniupnpc.c:270:34: warning: unused parameter ‘minissdpdsock’ [-Wunused-parameter]
                     const char * minissdpdsock, int localport,
                     ~~~~~~~~~~~~~^~~~~~~~~~~~~
2021-01-27 13:10:03 +01:00
Thomas Bernard 36cc66edda Visual Studio : define INTERNAL_NAME
fixes #522
2021-01-23 00:05:38 +01:00
pastdue 1d38b37732 Fallback for earlier Apple platforms that lack clock_gettime 2021-01-15 17:15:54 -05:00
Thomas Bernard 2adcf3f432
miniupnpcmodule.c: throw an exception in UPnP_discover()
fixes #521
2021-01-15 20:21:02 +01:00
Thomas Bernard 474658716f
miniupnpc: update Changelog.txt
regarding bfbe42d392
2021-01-04 01:17:50 +01:00
Thomas Bernard 184ed52069
upnpc.c: fix SetRedirectAndTest() args. 2021-01-04 01:16:02 +01:00
Pali Rohár bfbe42d392 miniupnpc: Fix usage of IP_MULTICAST_IF with struct ip_mreqn
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.
2021-01-04 00:29:58 +01:00
Pali Rohár 36a6913970 miniupnpc: Add missing checks for if_nametoindex() return value
if_nametoindex() returns zero value on failure. Add missing error handling.
2020-12-30 13:41:20 +01:00
Pali Rohár 0d5b416e05 miniupnpc: Fix checking for inet_pton() errors
inet_pton() indicates error by zero or negative return value.
2020-12-30 13:39:36 +01:00
Thomas Bernard 544e6fcc73
miniupnpc: version 2.2.1 2020-12-20 19:11:18 +01:00
Thomas Bernard ba130320f4
.gitignore: wingenminiupnpcstrings 2020-11-30 01:59:15 +01:00
Thomas Bernard ca4e0342bf
genminiupnpcstrings.vbs: generates rc_version.h as well
see #512
2020-11-30 01:55:06 +01:00
Thomas Bernard b28462b62a
wingenminiupnpcstrings also generates rc_version.h 2020-11-30 01:48:15 +01:00
Thomas Bernard f04dbafe09
mingw32: build resources for .dll 2020-11-30 01:21:26 +01:00
Stanislas Dolcini 44dd54051c Add RC file 2020-11-28 11:49:59 +01:00
Cristian Morales Vega 677e0db636 Install cmake config file
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.
2020-11-27 18:49:51 +00:00
Thomas Bernard 5b5ce9e49e Merge remote-tracking branch 'RedDwarf69/stuff' into master 2020-11-27 19:08:35 +01:00
Cristian Morales Vega f1f8ae3659 cmake: use GNUInstallDirs 2020-11-25 11:09:21 +00:00
Cristian Morales Vega efcc616110 cmake: remove wrong target_include_directories() 2020-11-24 16:37:35 +00:00
Thomas Bernard ae5e8fa9af Merge remote-tracking branch 'RedDwarf69/pkgconfig' into master 2020-11-23 18:30:18 +01:00
Cristian Morales Vega ed989c3fa2 miniupnpc.pc: remove "miniupnpc" from includedir 2020-11-22 19:51:57 +00:00
Cristian Morales Vega 876109c890 cmake: update version 2020-11-22 19:31:42 +00:00
Thomas Bernard 9793607a76
miniupnpc version 2.2.0 2020-11-09 20:52:52 +01:00
Thomas Bernard 82e874ada9
remove build warning.
PortMappingNumberOfEntries is supposed to be limited to 65536

should fix #501
2020-11-09 20:38:45 +01:00
Thomas Bernard 1756c9259a
github workflows: try to upload win32 binaries 2020-11-05 13:24:59 +01:00
Pali Rohár 26e8f7831a Use GetBestInterface() instead of GetBestInterfaceEx()
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.
2020-11-04 23:59:03 +01:00
Pali Rohár 23f492fd1b Fix compilation when _WIN32_WINNT_VISTA macro is not defined
Older version of i586-mingw32msvc-gcc compiler does not define
_WIN32_WINNT_VISTA macro. Therefore preprocessor #if condition is
incorrectly evaluated.
2020-11-04 23:57:43 +01:00
Thomas Bernard 8b44224b91 2020 2020-11-04 23:42:37 +01:00
Thomas Bernard 0a9750602d Merge branch 'win32_snprintf' 2020-11-04 23:40:37 +01:00
Thomas Bernard 25a78aa385 add win32_snprintf.h 2020-11-04 23:37:07 +01:00
Thomas Bernard 29797cf607 2019 => 2020 2020-10-31 11:36:06 +01:00