diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2012-03-02 19:54:48 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2012-03-02 19:54:48 +0000 |
commit | 7a1e4ef606a814b124fc35136c2821484981e6cb (patch) | |
tree | 1c3dc8de2e34644623bf0224a9065616efaa2c0d /net | |
parent | 0dc9431bdb989231cfa20560d69aebebd487a926 (diff) |
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.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ifconfig.sh.Linux.in | 2 | ||||
-rw-r--r-- | net/iproute2.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index 80a0b987..9eaa7c56 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -19,7 +19,7 @@ _down() _exists() { - grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev + [ -e /sys/class/net/"$IFACE" ] } _ifindex() diff --git a/net/iproute2.sh b/net/iproute2.sh index 09912bf4..e06152f8 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -20,7 +20,7 @@ _down() _exists() { - grep -Eq "^[[:space:]]*${IFACE}:" /proc/net/dev + [ -e /sys/class/net/"$IFACE" ] } _ifindex() |