diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2011-05-30 09:41:38 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2011-05-30 09:41:38 +0000 |
commit | 3e622db1cbb81de13faecb592031cdd83fe578a0 (patch) | |
tree | 4613945d04e04e4d39644b15a003d9904c1db392 /tools/regression/netinet/udpconnectjail | |
parent | 0d9535331d60ad3e382f936c73d0888a3baa2022 (diff) |
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
Notes
Notes:
svn path=/head/; revision=222487
Diffstat (limited to 'tools/regression/netinet/udpconnectjail')
-rw-r--r-- | tools/regression/netinet/udpconnectjail/udpconnectjail.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/regression/netinet/udpconnectjail/udpconnectjail.c b/tools/regression/netinet/udpconnectjail/udpconnectjail.c index 7151ca442463..718836cbe99b 100644 --- a/tools/regression/netinet/udpconnectjail/udpconnectjail.c +++ b/tools/regression/netinet/udpconnectjail/udpconnectjail.c @@ -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); |