Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2012 01:43:22 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239602 - head/usr.sbin/jail
Message-ID:  <201208230143.q7N1hM61034213@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Thu Aug 23 01:43:22 2012
New Revision: 239602
URL: http://svn.freebsd.org/changeset/base/239602

Log:
  Pre-separate IP addresses passed on the command line, so they can be
  properly parsed for interface prefixes and netmask suffixes.  This was
  already done for the old-style (fixed) command line, but missed for
  the new-style.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/jail/jail.c

Modified: head/usr.sbin/jail/jail.c
==============================================================================
--- head/usr.sbin/jail/jail.c	Thu Aug 23 01:43:01 2012	(r239601)
+++ head/usr.sbin/jail/jail.c	Thu Aug 23 01:43:22 2012	(r239602)
@@ -304,9 +304,33 @@ main(int argc, char **argv)
 				for (i++; i < argc; i++)
 					add_param(NULL, NULL, IP_COMMAND,
 					    argv[i]);
-				break;
 			}
-			add_param(NULL, NULL, 0, argv[i]);
+#ifdef INET
+			else if (!strncmp(argv[i], "ip4.addr=", 9)) {
+				for (cs = argv[i] + 9;; cs = ncs + 1) {
+					ncs = strchr(cs, ',');
+					if (ncs)
+						*ncs = '\0';
+					add_param(NULL, NULL, KP_IP4_ADDR, cs);
+					if (!ncs)
+						break;
+				}
+			}
+#endif
+#ifdef INET6
+			else if (!strncmp(argv[i], "ip6.addr=", 9)) {
+				for (cs = argv[i] + 9;; cs = ncs + 1) {
+					ncs = strchr(cs, ',');
+					if (ncs)
+						*ncs = '\0';
+					add_param(NULL, NULL, KP_IP6_ADDR, cs);
+					if (!ncs)
+						break;
+				}
+			}
+#endif
+			else
+				add_param(NULL, NULL, 0, argv[i]);
 		}
 	} else {
 		/* From the config file, perhaps with a specified jail */



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