summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox/0001-sysctl-ignore-EIO-of-stable_secret-below-proc-sys-ne.patch
blob: 9f58eaef67338766232e0b2b1e9920629fb45cfe (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
40
From 3bee0460d74bad88eca6592e63ca926961b43b67 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Fri, 6 Mar 2020 16:09:26 +0800
Subject: [PATCH] sysctl: ignore EIO of stable_secret below
 /proc/sys/net/ipv6/conf

Avoid confusing messages caused by EIO on reading
/proc/sys/net/ipv6/conf/*/stable_secret if those are not set yet.
Make it behave the same as procps(>=3.3.13).

Upstream-Status: Submitted [busybox@busybox.net mailing list]

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 procps/sysctl.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/procps/sysctl.c b/procps/sysctl.c
index 6d77185ca..42c51cc91 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -202,7 +202,14 @@ static int sysctl_act_on_setting(char *setting)
 		value = cptr = xmalloc_read(fd, NULL);
 		close(fd);
 		if (value == NULL) {
-			bb_perror_msg("error reading key '%s'", outname);
+			switch (errno) {
+				case EIO:
+					/* Ignore stable_secret below /proc/sys/net/ipv6/conf */
+					break;
+				default:
+					bb_perror_msg("error reading key '%s'", outname);
+					break;
+			}
 			retval = EXIT_FAILURE;
 			goto end;
 		}
-- 
2.17.1