+int readExternalAddress(char* address) {
+ FILE *fp = fopen("/var/ipfire/red/local-ipaddress", "r");
+ if (!fp)
+ goto ERROR;
+
+ int r = fscanf(fp, "%s", address);
+ fclose(fp);
+
+ if (r < 0)
+ goto ERROR;
+
+ /* In case the read IP address is not valid, we empty
+ * the content of address and return non-zero. */
+ if (!VALID_IP(address))
+ goto ERROR;
+
+ return 0;
+
+ERROR:
+ address = NULL;
+ return 1;
+}
+