Date: Sun, 25 Jan 2015 20:37:33 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277714 - head/sbin/ipfw Message-ID: <201501252037.t0PKbXNW070662@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Sun Jan 25 20:37:32 2015 New Revision: 277714 URL: https://svnweb.freebsd.org/changeset/base/277714 Log: 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 Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Sun Jan 25 20:16:45 2015 (r277713) +++ head/sbin/ipfw/nat.c Sun Jan 25 20:37:32 2015 (r277714) @@ -163,9 +163,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?201501252037.t0PKbXNW070662>