1 |
commit: f42ec82f21f3760b829507344ad0ae761e1d59aa |
2 |
Author: 3PO <r2d2 <AT> freakmail <DOT> de> |
3 |
AuthorDate: Sun Dec 31 21:50:57 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 5 20:56:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=f42ec82f |
7 |
|
8 |
net-online: only process symbolic links in /sys/class/net |
9 |
|
10 |
The /sys/class/net directory contains files which are not symlinks if |
11 |
the system has bonded devices [1]. We should ignore these files. |
12 |
|
13 |
This fixes #196. |
14 |
|
15 |
[1] https://elkano.org/blog/manage-interface-bondings-sysfs-interface/ |
16 |
|
17 |
init.d/net-online.in | 1 + |
18 |
1 file changed, 1 insertion(+) |
19 |
|
20 |
diff --git a/init.d/net-online.in b/init.d/net-online.in |
21 |
index 1175f29c..484fe87d 100644 |
22 |
--- a/init.d/net-online.in |
23 |
+++ b/init.d/net-online.in |
24 |
@@ -23,6 +23,7 @@ get_interfaces() |
25 |
{ |
26 |
local ifname iftype |
27 |
for ifname in /sys/class/net/*; do |
28 |
+ [ -h "${ifname}" ] && continue |
29 |
read iftype < ${ifname}/type |
30 |
[ "$iftype" = "1" ] && printf "%s " ${ifname##*/} |
31 |
done |