From df286ef56d556d8811aae0e9c1c1ed44c485945f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 9 Aug 2020 15:30:48 -0700 Subject: [PATCH] Use indefinite mappings if the IGD returns unexpected error codes --- miss/miss.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/miss/miss.cpp b/miss/miss.cpp index af0d2f8..58f1951 100644 --- a/miss/miss.cpp +++ b/miss/miss.cpp @@ -96,6 +96,9 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const // NoSuchEntryInArray printf("NOT FOUND" NL); } + else if (err == 606) { + printf("UNAUTHORIZED" NL); + } else if (err == UPNPCOMMAND_SUCCESS) { // Some routers change the description, so we can't check that here if (!strcmp(intClient, myAddr)) { @@ -151,6 +154,10 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const } else { printf("ERROR %d (%s)" NL, err, strupnperror(err)); + + // If we get a strange error from the router, we'll assume it's some old broken IGDv1 + // device and only use indefinite lease durations to hopefully avoid confusing it. + indefinite = true; } // Bail if GameStream is disabled