mirror of
https://github.com/moonlight-stream/Internet-Hosting-Tool.git
synced 2025-07-03 00:06:11 +00:00
Try deleting conflicting UPnP mappings
This commit is contained in:
parent
774878ed17
commit
e62ed6ccc5
@ -134,11 +134,24 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// UPnP IGDs won't let unauthenticated clients delete other conflicting port mappings
|
|
||||||
// for security reasons, so we have to give up in this case.
|
|
||||||
printf("CONFLICT: %s %s" NL, intClient, desc);
|
printf("CONFLICT: %s %s" NL, intClient, desc);
|
||||||
|
|
||||||
|
// Some UPnP IGDs won't let unauthenticated clients delete other conflicting port mappings
|
||||||
|
// for security reasons, but we will give it a try anyway.
|
||||||
|
printf("Trying to delete conflicting UPnP mapping for %s %s -> %s...", protoStr, portStr, intClient);
|
||||||
|
err = UPNP_DeletePortMapping(urls->controlURL, data->first.servicetype, portStr, protoStr, nullptr);
|
||||||
|
if (err == UPNPCOMMAND_SUCCESS) {
|
||||||
|
printf("OK" NL);
|
||||||
|
}
|
||||||
|
else if (err == 606) {
|
||||||
|
printf("UNAUTHORIZED" NL);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
printf("ERROR %d" NL, err);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("ERROR %d (%s)" NL, err, strupnperror(err));
|
printf("ERROR %d (%s)" NL, err, strupnperror(err));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user