svn commit: r278324 - in stable: 10/sbin/ipfw 9/sbin/ipfw

John Baldwin jhb at FreeBSD.org
Fri Feb 6 18:13:31 UTC 2015


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);


More information about the svn-src-stable-9 mailing list