summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-core
diff options
context:
space:
mode:
authorRatan Gupta <ratagupt@in.ibm.com>2017-07-20 09:38:11 +0300
committerPatrick Williams <patrick@stwcx.xyz>2017-07-25 21:52:03 +0300
commit87497e8ebce78079ea5423ecb6080e82cfa36106 (patch)
tree6b8339f4918dfa733f5a020bc958f2767469a07e /meta-phosphor/common/recipes-core
parent246c6f9e850d48c696bdd43726932299d5d00a77 (diff)
downloadopenbmc-87497e8ebce78079ea5423ecb6080e82cfa36106.tar.xz
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. Rationale to not enable the kernel with namespace support as it brings lot of unnecessary code. Resolves openbmc/openbmc#1949 Change-Id: I3b52a8c61b9bd3e3fff02cfab998c3746b8b72c6 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-core')
-rw-r--r--meta-phosphor/common/recipes-core/systemd/systemd/0005-dont-return-error-if-unable-to-create-network-namespace.patch39
-rw-r--r--meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend3
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-core/systemd/systemd/0005-dont-return-error-if-unable-to-create-network-namespace.patch b/meta-phosphor/common/recipes-core/systemd/systemd/0005-dont-return-error-if-unable-to-create-network-namespace.patch
new file mode 100644
index 000000000..d83bf72ef
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/systemd/0005-dont-return-error-if-unable-to-create-network-namespace.patch
@@ -0,0 +1,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
+
diff --git a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
index ab95deb1a..627cd0cf9 100644
--- a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
@@ -11,6 +11,9 @@ SRC_URI += "file://0001-Export-message_append_cmdline.patch"
SRC_URI += "file://0002-systemd-Make-pam-compile-shared-library.patch"
SRC_URI += "file://0003-basic-Factor-out-string-checking-from-name_to_prefix.patch"
SRC_URI += "file://0004-basic-Use-path-escaping-when-mangling-path-instances.patch"
+#TODO upstream the below patch via below issue
+#https://github.com/openbmc/openbmc/issues/2016
+SRC_URI += "file://0005-dont-return-error-if-unable-to-create-network-namespace.patch"
RRECOMMENDS_${PN} += "obmc-targets"
FILES_${PN} += "${libdir}/systemd/network/default.network"