From owner-svn-src-head@FreeBSD.ORG Mon May 30 09:41:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F282106566B; Mon, 30 May 2011 09:41:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FADA8FC13; Mon, 30 May 2011 09:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4U9fd58069988; Mon, 30 May 2011 09:41:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4U9fdbL069986; Mon, 30 May 2011 09:41:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201105300941.p4U9fdbL069986@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 30 May 2011 09:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222487 - head/tools/regression/netinet/udpconnectjail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2011 09:41:39 -0000 Author: bz Date: Mon May 30 09:41:38 2011 New Revision: 222487 URL: http://svn.freebsd.org/changeset/base/222487 Log: Upgrade jail(2) to latest jail(2) API to make the regression test work again. Eventually should switch to jail_set(2). Reported by: rwatson MFC after: 10 days Modified: head/tools/regression/netinet/udpconnectjail/udpconnectjail.c Modified: head/tools/regression/netinet/udpconnectjail/udpconnectjail.c ============================================================================== --- head/tools/regression/netinet/udpconnectjail/udpconnectjail.c Mon May 30 09:34:15 2011 (r222486) +++ head/tools/regression/netinet/udpconnectjail/udpconnectjail.c Mon May 30 09:41:38 2011 (r222487) @@ -77,6 +77,7 @@ main(int argc, __unused char *argv[]) { struct sockaddr_in sin; struct jail thejail; + struct in_addr ia4; if (argc != 1) usage(); @@ -94,12 +95,18 @@ main(int argc, __unused char *argv[]) /* * Now re-run in a jail. + * XXX-BZ should switch to jail_set(2). */ + ia4.s_addr = htonl(INADDR_LOOPBACK); + bzero(&thejail, sizeof(thejail)); - thejail.version = 0; + thejail.version = JAIL_API_VERSION; thejail.path = "/"; thejail.hostname = "jail"; - thejail.ip_number = INADDR_LOOPBACK; + thejail.jailname = "udpconnectjail"; + thejail.ip4s = 1; + thejail.ip4 = &ia4; + if (jail(&thejail) < 0) errx(-1, "jail: %s", strerror(errno)); test("in jail", &sin);