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. Differential Revision: https://reviews.freebsd.org/D1539 Reviewed by: melifaro, glebius, gnn MFC after: 1 week
This commit is contained in:
parent
8d44440ad9
commit
2aa533b91d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277714
@ -163,8 +163,8 @@ set_addr_dynamic(const char *ifn, struct nat44_cfg_nat *n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sin == NULL)
|
if (sin == NULL)
|
||||||
errx(1, "%s: cannot get interface address", ifn);
|
n->ip.s_addr = htonl(INADDR_ANY);
|
||||||
|
else
|
||||||
n->ip = sin->sin_addr;
|
n->ip = sin->sin_addr;
|
||||||
strncpy(n->if_name, ifn, IF_NAMESIZE);
|
strncpy(n->if_name, ifn, IF_NAMESIZE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user