miniupnpc: Show error message when GetExternalIPAddress returns empty string

According to IGD v2.0 specification GetExternalIPAddress can return also
empty string in case of error.
This commit is contained in:
Pali Rohár 2021-03-28 17:33:15 +02:00
parent 79ca440f73
commit 20ee72f9c8
1 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,8 @@ static void DisplayInfos(struct UPNPUrls * urls,
externalIPAddress);
if(r != UPNPCOMMAND_SUCCESS) {
printf("GetExternalIPAddress failed. (errorcode=%d)\n", r);
} else if(!externalIPAddress[0]) {
printf("GetExternalIPAddress failed. (empty string)\n");
} else {
printf("ExternalIPAddress = %s\n", externalIPAddress);
}