Date: Fri, 6 Feb 2015 18:13:31 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r278324 - in stable: 10/sbin/ipfw 9/sbin/ipfw Message-ID: <201502061813.t16IDVgw052047@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri Feb 6 18:13:29 2015 New Revision: 278324 URL: https://svnweb.freebsd.org/changeset/base/278324 Log: 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. Modified: stable/9/sbin/ipfw/nat.c Directory Properties: stable/9/sbin/ipfw/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/ipfw/nat.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/ipfw/nat.c ============================================================================== --- stable/9/sbin/ipfw/nat.c Fri Feb 6 17:54:53 2015 (r278323) +++ stable/9/sbin/ipfw/nat.c Fri Feb 6 18:13:29 2015 (r278324) @@ -156,9 +156,9 @@ set_addr_dynamic(const char *ifn, struct } } 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502061813.t16IDVgw052047>