From 7a1e4ef606a814b124fc35136c2821484981e6cb Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Fri, 2 Mar 2012 19:54:48 +0000 Subject: 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 --- net/ifconfig.sh.Linux.in | 2 +- net/iproute2.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'net') 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() -- cgit v1.2.3