summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-core/systemd/systemd/0005-dont-return-error-if-unable-to-create-network-namespace.patch
blob: d83bf72ef4e1dc5d0f1ddf7e9fcfa3dfa7e59524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 870b79559cd5841b3f680c914b4b2e770a9961cf Mon Sep 17 00:00:00 2001
From: Ratan Gupta <ratagupt@in.ibm.com>
Date: Thu, 20 Jul 2017 11:59:14 +0530
Subject: [PATCH] Don't return the error if unable to create the network
 namespace

On systems where kernel is not configured with namespace support
then don't return error during setting up network namespace.

Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
---
 src/core/namespace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/namespace.c b/src/core/namespace.c
index 1195e9a..f30dacf 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -986,7 +986,7 @@ int setup_netns(int netns_storage_socket[2]) {
                 /* Nothing stored yet, so let's create a new namespace */
 
                 if (unshare(CLONE_NEWNET) < 0) {
-                        r = -errno;
+                        r = 0;
                         goto fail;
                 }
 
@@ -994,7 +994,7 @@ int setup_netns(int netns_storage_socket[2]) {
 
                 netns = open("/proc/self/ns/net", O_RDONLY|O_CLOEXEC|O_NOCTTY);
                 if (netns < 0) {
-                        r = -errno;
+                        r = 0;
                         goto fail;
                 }
 
-- 
1.9.1