Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: net/
Date: Fri, 02 Mar 2012 19:55:12
Message-Id: 1330718088.7a1e4ef606a814b124fc35136c2821484981e6cb.robbat2@gentoo
1 commit: 7a1e4ef606a814b124fc35136c2821484981e6cb
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 2 19:54:48 2012 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 2 19:54:48 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=7a1e4ef6
7
8 Bug #405491: _exists can give a false negative since /proc/net/dev can be slow to update sometimes when interfaces are added rapidly. Use sysfs instead.
9
10 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
11
12 ---
13 net/ifconfig.sh.Linux.in | 2 +-
14 net/iproute2.sh | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17 diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in
18 index 80a0b98..9eaa7c5 100644
19 --- a/net/ifconfig.sh.Linux.in
20 +++ b/net/ifconfig.sh.Linux.in
21 @@ -19,7 +19,7 @@ _down()
22
23 _exists()
24 {
25 - grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev
26 + [ -e /sys/class/net/"$IFACE" ]
27 }
28
29 _ifindex()
30
31 diff --git a/net/iproute2.sh b/net/iproute2.sh
32 index 09912bf..e06152f 100644
33 --- a/net/iproute2.sh
34 +++ b/net/iproute2.sh
35 @@ -20,7 +20,7 @@ _down()
36
37 _exists()
38 {
39 - grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev
40 + [ -e /sys/class/net/"$IFACE" ]
41 }
42
43 _ifindex()