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

11
net.cc
View File

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