From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 6 18:13:30 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A40D974E; Fri, 6 Feb 2015 18:13:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FA7A86D; Fri, 6 Feb 2015 18:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t16IDUD5052040; Fri, 6 Feb 2015 18:13:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t16IDUDq052039; Fri, 6 Feb 2015 18:13:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201502061813.t16IDUDq052039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 6 Feb 2015 18:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278324 - in stable: 10/sbin/ipfw 9/sbin/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 18:13:30 -0000 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/10/sbin/ipfw/nat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/ipfw/nat.c Directory Properties: stable/9/sbin/ipfw/ (props changed) Modified: stable/10/sbin/ipfw/nat.c ============================================================================== --- stable/10/sbin/ipfw/nat.c Fri Feb 6 17:54:53 2015 (r278323) +++ stable/10/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);