Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / qo / qodem / qodem-fix-miniupnpc-2.2.8.patch
blobba4335c7ea51dc41bb8c9d30873bd3abe603b225
1 diff --git a/source/netclient.c b/source/netclient.c
2 index 6b6f99ec9b...88d4b91077 100644
3 --- a/source/netclient.c
4 +++ b/source/netclient.c
5 @@ -496,7 +496,7 @@
6 */
7 device_list = upnpDiscover(2000, NULL, NULL, 0, 0, 2, NULL);
8 # else
9 -# if (MINIUPNPC_API_VERSION == 17)
10 +# if (MINIUPNPC_API_VERSION >= 17)
12 * Version 17
14 @@ -516,8 +516,13 @@
16 if (device_list != NULL) {
18 +#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
19 rc = UPNP_GetValidIGD(device_list, &upnp_urls, &upnp_igd_datas,
20 local_host, sizeof(local_host));
21 +#else
22 + rc = UPNP_GetValidIGD(device_list, &upnp_urls, &upnp_igd_datas,
23 + local_host, sizeof(local_host), NULL, 0);
24 +#endif
26 switch (rc) {
28 @@ -525,13 +530,27 @@
29 DLOG(("Found valid IGD : %s\n", upnp_urls.controlURL));
30 break;
32 +#if (MINIUPNPC_API_VERSION >= 18)
33 case 2:
34 + DLOG(("Found a (reserved?) IGD : %s\n", upnp_urls.controlURL));
35 + DLOG(("Trying to continue anyway\n"));
36 + break;
37 +#endif
39 +#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
40 + case 2:
41 +#else
42 + case 3:
43 +#endif
44 DLOG(("Found a (not connected?) IGD : %s\n", upnp_urls.controlURL));
45 DLOG(("Trying to continue anyway\n"));
46 break;
48 +#if (MINIUPNPC_API_VERSION <= 17) || !defined(MINIUPNPC_API_VERSION)
49 case 3:
50 +#else
51 + case 4:
52 +#endif
53 DLOG(("UPnP device found. Is it an IGD ? : %s\n",
54 upnp_urls.controlURL));
55 DLOG(("Trying to continue anyway\n"));