code formatting

This commit is contained in:
Wiktor Garbacz 2018-10-24 10:31:14 +02:00
parent eee0cec302
commit 7fe87b41c7
3 changed files with 11 additions and 10 deletions

View File

@ -192,7 +192,7 @@ message NsJailConfig {
Homepage of the project: https://github.com/google/kafel */
optional string seccomp_policy_file = 57;
repeated string seccomp_string = 58;
/* Setting it to true makes audit write seccomp logs to dmesg */
/* Setting it to true makes audit write seccomp logs to dmesg */
optional bool seccomp_log = 77 [default = false];
/* If > 0, maximum cumulative size of RAM used inside any jail */

17
net.cc
View File

@ -188,17 +188,18 @@ bool initNsFromParent(nsjconf_t* nsjconf, int pid) {
nsjconf->iface_vs.c_str(), pid);
std::vector<std::string> argv;
if ( nsjconf->iface_vs_ma != "" ) {
argv = {"/sbin/ip", "link", "add", "link", nsjconf->iface_vs,
"name", IFACE_NAME, "netns", std::to_string(pid), "address", nsjconf->iface_vs_ma, "type", "macvlan", "mode", "bridge"};
if (nsjconf->iface_vs_ma != "") {
argv = {"/sbin/ip", "link", "add", "link", nsjconf->iface_vs, "name", IFACE_NAME,
"netns", std::to_string(pid), "address", nsjconf->iface_vs_ma, "type",
"macvlan", "mode", "bridge"};
} else {
argv = {"/sbin/ip", "link", "add", "link", nsjconf->iface_vs,
"name", IFACE_NAME, "netns", std::to_string(pid), "type", "macvlan", "mode", "bridge"};
argv = {"/sbin/ip", "link", "add", "link", nsjconf->iface_vs, "name", IFACE_NAME,
"netns", std::to_string(pid), "type", "macvlan", "mode", "bridge"};
}
if (subproc::systemExe(argv, environ) != 0) {
LOG_E("Couldn't create MACVTAP interface for '%s'", nsjconf->iface_vs.c_str());
return false;
LOG_E("Couldn't create MACVTAP interface for '%s'", nsjconf->iface_vs.c_str());
return false;
}
return true;
}

View File

@ -125,7 +125,7 @@ struct nsjconf_t {
std::string iface_vs_ip;
std::string iface_vs_nm;
std::string iface_vs_gw;
std::string iface_vs_ma;
std::string iface_vs_ma;
std::string cgroup_mem_mount;
std::string cgroup_mem_parent;
size_t cgroup_mem_max;