Page MenuHomeFreeBSD

jail: declare argument structure of jail(2) with const fields
Needs ReviewPublic

Authored by glebius on Sat, Oct 3, 4:39 AM.

Details

Reviewers
jamie
kevans
Group Reviewers
Jails
Summary

The syscall doesn't modify this memory. With added 'const' one can use
string literals and const IP addresses to initialize a jail. Example:

const struct in_addr laddr = { htonl(INADDR_LOOPBACK) };
struct jail jconf = {

		.version = JAIL_API_VERSION,
		.path =  "/",
		.hostname = "test",
		.ip4s = 1,
		.ip4 = &laddr,

};
error = jail(&jconf);

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77680
Build 74563: arc lint + arc unit