Avoid attempting to delete UPnP rules if the description doesn't match

This commit is contained in:
Cameron Gutman
2019-04-05 00:39:27 -07:00
parent 3d9e14fb56
commit 204dde8a73
+2 -1
View File
@@ -97,7 +97,8 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const
printf("NOT FOUND" NL); printf("NOT FOUND" NL);
} }
else if (err == UPNPCOMMAND_SUCCESS) { else if (err == UPNPCOMMAND_SUCCESS) {
if (!strcmp(intClient, myAddr) && !strcmp(desc, myDesc)) { // Some routers change the description, so we can't check that here
if (!strcmp(intClient, myAddr)) {
if (atoi(leaseDuration) == 0) { if (atoi(leaseDuration) == 0) {
printf("OK (Permanent)" NL); printf("OK (Permanent)" NL);
} }