iproute2: Improve "ip netns add" failure error message
Report the name of the network namespace that could not be added. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
8e2d47dce2
commit
4395d48c78
|
|
@ -135,8 +135,8 @@ static int netns_exec(int argc, char **argv)
|
||||||
snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
|
snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
|
||||||
netns = open(net_path, O_RDONLY);
|
netns = open(net_path, O_RDONLY);
|
||||||
if (netns < 0) {
|
if (netns < 0) {
|
||||||
fprintf(stderr, "Cannot open network namespace: %s\n",
|
fprintf(stderr, "Cannot open network namespace %s: %s\n",
|
||||||
strerror(errno));
|
name, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (setns(netns, CLONE_NEWNET) < 0) {
|
if (setns(netns, CLONE_NEWNET) < 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue