From d64af528f3ffc8c637cffcf7846e15d0b044ba09 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 6 Feb 2015 18:13:29 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.freebsd.org/base/stable/10@278324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/ipfw/nat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c index bff28e156..de1492188 100644 --- a/sbin/ipfw/nat.c +++ b/sbin/ipfw/nat.c @@ -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); -- 2.45.0