Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2010 20:25:55 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r214433 - projects/jailconf/usr.sbin/jail
Message-ID:  <201010272025.o9RKPtsM027803@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Wed Oct 27 20:25:55 2010
New Revision: 214433
URL: http://svn.freebsd.org/changeset/base/214433

Log:
  Use a little more "ifdef INET6".

Modified:
  projects/jailconf/usr.sbin/jail/config.c

Modified: projects/jailconf/usr.sbin/jail/config.c
==============================================================================
--- projects/jailconf/usr.sbin/jail/config.c	Wed Oct 27 19:01:09 2010	(r214432)
+++ projects/jailconf/usr.sbin/jail/config.c	Wed Oct 27 20:25:55 2010	(r214433)
@@ -580,13 +580,23 @@ ip_params(struct cfjail *j)
 			}
 			if ((cs = strchr(s->s, '/'))) {
 				prefix = strtol(cs + 1, &ep, 10);
-				if (!isip6 && *ep == '.'
+				if (
+#ifdef INET6
+				    !isip6 &&
+#endif
+				    *ep == '.'
 				    ? inet_pton(AF_INET, cs + 1, &addr4) != 1
-				    : *ep || prefix < 0 || prefix >
-				    (isip6 ? 128 : 32)) {
-					jail_warnx(j, isip6
-					    ? "ip6.addr: bad prefixlen \"%s\""
-					    : "ip4.addr: bad netmask \"%s\"",
+				    : *ep || prefix < 0 || prefix > (
+#ifdef INET6
+				      isip6 ? 128 :
+#endif
+				      32)) {
+					jail_warnx(j,
+#ifdef INET6
+					    isip6
+					    ? "ip6.addr: bad prefixlen \"%s\"" :
+#endif
+					    "ip4.addr: bad netmask \"%s\"",
 					    cs);
 					error = -1;	
 				}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010272025.o9RKPtsM027803>