Skip to content

Commit

Permalink
miniupnpc: Show error message when GetExternalIPAddress returns empty…
Browse files Browse the repository at this point in the history
… string

According to IGD v2.0 specification GetExternalIPAddress can return also
empty string in case of error.
  • Loading branch information
pali committed Mar 28, 2021
1 parent 79ca440 commit 20ee72f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions miniupnpc/upnpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 20ee72f

Please sign in to comment.