net: log msgs

This commit is contained in:
Robert Swiecki 2017-05-21 22:29:01 +02:00
parent 2797474557
commit 1a027f9baa
2 changed files with 7 additions and 2 deletions

8
net.c
View File

@ -59,6 +59,8 @@ bool netInitNsFromParent(struct nsjconf_t *nsjconf, int pid)
return true;
}
LOG_D("Putting iface:'%s' into namespace of PID:%d (with libnl3)", nsjconf->iface, pid);
struct nl_sock *sk = nl_socket_alloc();
if (sk == NULL) {
LOG_E("Could not allocate socket with nl_socket_alloc()");
@ -124,6 +126,8 @@ bool netInitNsFromParent(struct nsjconf_t *nsjconf, int pid)
return true;
}
LOG_D("Putting iface:'%s' into namespace of PID:%d (with /sbin/ip)", nsjconf->iface, pid);
char pid_str[256];
snprintf(pid_str, sizeof(pid_str), "%d", pid);
@ -337,7 +341,7 @@ static bool netConfigureVs(struct nsjconf_t *nsjconf)
return false;
}
if (addr.s_addr == INADDR_ANY) {
LOG_I("IPv4 address for interface '%s' not set", IFACE_NAME);
LOG_D("IPv4 address for interface '%s' not set", IFACE_NAME);
close(sock);
return true;
}
@ -375,7 +379,7 @@ static bool netConfigureVs(struct nsjconf_t *nsjconf)
return false;
}
if (addr.s_addr == INADDR_ANY) {
LOG_I("Gateway address for '%s' is not set", IFACE_NAME);
LOG_D("Gateway address for '%s' is not set", IFACE_NAME);
close(sock);
return true;
}

View File

@ -33,6 +33,7 @@ void subprocDisplay(struct nsjconf_t *nsjconf);
void subprocKillAll(struct nsjconf_t *nsjconf);
int subprocSystem(const char **argv, char **env);
pid_t subprocClone(uintptr_t flags);
void subprocCloneFlags(struct nsjconf_t *nsjconf);
/* Returns the exit code of the first failing subprocess, or 0 if none fail */
int subprocReap(struct nsjconf_t *nsjconf);