summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2011-04-29 14:44:50 (GMT)
committer Jaromil <jaromil@dyne.org>2011-04-29 14:44:50 (GMT)
commitb056cc6b5869bb97f06b21b69b86550a7548a698 (patch)
tree2c7423241ebd3e1bec6eb4a5a7cd334ecb4421b3
parent0c3e751de7c16f0975dfa6533823d2a7701c8df5 (diff)
compatibility with new miniupnp API
-rw-r--r--src/discover.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/discover.c b/src/discover.c
index 2da2ffa..1802ea7 100644
--- a/src/discover.c
+++ b/src/discover.c
@@ -41,10 +41,17 @@ int upnp_discover()
struct UPNPDev *dev;
struct UPNPUrls urls;
struct IGDdatas data;
- int r;
+ int r, err;
+ // damn programmers change API prototypes in headers without versioning
+ // we'll use this define to detect
+
+#ifdef UPNPDISCOVER_SUCCESS
+ devlist = upnpDiscover(1000, multicastif, minissdpdpath, 0, &err);
+#else
devlist = upnpDiscover(1000, multicastif, minissdpdpath, 0);
-
+#endif
+
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
if (!r) {
fprintf(stderr,"no valid UPnP devices found\n");