svn commit: r222487 - head/tools/regression/netinet/udpconnectjail
Bjoern A. Zeeb
bz at FreeBSD.org
Mon May 30 09:41:39 UTC 2011
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);
More information about the svn-src-head
mailing list