diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index <HASH>..<HASH> 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -712,11 +712,11 @@ func setupUPnP() {
 					l.Warnln("Failed to create UPnP port mapping")
 				} else {
 					l.Infof("Created UPnP port mapping for external port %d on UPnP device %s.", externalPort, igd.FriendlyIdentifier())
-				}
-			}
 
-			if opts.UPnPRenewal > 0 {
-				go renewUPnP(port)
+					if opts.UPnPRenewal > 0 {
+						go renewUPnP(port)
+					}
+				}
 			}
 		}
 	} else {
Fix UPnP log spam on networks without UPnP IGDs (see #<I>)

We should only run the UPnP port mapping renewal routine if the initial
discovery and configuration succeed. This commit applies that logic.