MFC 277714:

natd(8) will work with an unconfigured interface and effectively not do
anything until the interface is assigned an address.  This fixes
ipfw_nat to do the same by using an IP of INADDR_ANY instead of
aborting the nat setup if the requested interface is not yet configured.
This commit is contained in:
jhb 2015-02-06 18:13:29 +00:00
parent b2ec547430
commit 1fa38dee26

View File

@ -156,9 +156,9 @@ set_addr_dynamic(const char *ifn, struct cfg_nat *n)
}
}
if (sin == NULL)
errx(1, "%s: cannot get interface address", ifn);
n->ip = sin->sin_addr;
n->ip.s_addr = htonl(INADDR_ANY);
else
n->ip = sin->sin_addr;
strncpy(n->if_name, ifn, IF_NAMESIZE);
free(buf);