mirror of
https://github.com/moonlight-stream/Internet-Hosting-Tool.git
synced 2025-07-03 08:15:40 +00:00
Fix memory leak if UPnP gateway lacked IPv6FC support
This commit is contained in:
parent
4ee5b9d28a
commit
9dd169ba02
@ -318,21 +318,22 @@ bool UPnPHandleDeviceList(struct UPNPDev* list, bool ipv6, bool enable, char* la
|
|||||||
if (ResolveStableIP6Address(localAddress)) {
|
if (ResolveStableIP6Address(localAddress)) {
|
||||||
printf("Stable global IPv6 address is: %s" NL, localAddress);
|
printf("Stable global IPv6 address is: %s" NL, localAddress);
|
||||||
|
|
||||||
if (data.IPv6FC.controlurl[0] == 0) {
|
// Don't try IPv6FC without a control URL
|
||||||
printf("IPv6 firewall control not supported by UPnP IGD!" NL);
|
if (data.IPv6FC.controlurl[0] != 0) {
|
||||||
return false;
|
int firewallEnabled;
|
||||||
}
|
ret = UPNP_GetFirewallStatus(urls.controlURL_6FC, data.IPv6FC.servicetype, &firewallEnabled, &pinholeAllowed);
|
||||||
|
if (ret == UPNPCOMMAND_SUCCESS) {
|
||||||
int firewallEnabled;
|
printf("UPnP IPv6 firewall control available. Firewall is %s, pinhole is %s" NL,
|
||||||
ret = UPNP_GetFirewallStatus(urls.controlURL_6FC, data.IPv6FC.servicetype, &firewallEnabled, &pinholeAllowed);
|
firewallEnabled ? "enabled" : "disabled",
|
||||||
if (ret == UPNPCOMMAND_SUCCESS) {
|
pinholeAllowed ? "allowed" : "disallowed");
|
||||||
printf("UPnP IPv6 firewall control available. Firewall is %s, pinhole is %s" NL,
|
}
|
||||||
firewallEnabled ? "enabled" : "disabled",
|
else {
|
||||||
pinholeAllowed ? "allowed" : "disallowed");
|
printf("UPnP IPv6 firewall control is unavailable with error %d (%s)" NL, ret, strupnperror(ret));
|
||||||
|
pinholeAllowed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("UPnP IPv6 firewall control is unavailable with error %d (%s)" NL, ret, strupnperror(ret));
|
printf("IPv6 firewall control not supported by UPnP IGD!" NL);
|
||||||
pinholeAllowed = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user