Package: bridge-utils
Version: 1.4-5
Severity: wishlist

ifup snippet for bridge-utils uses 'sleep 1' in loop in order to wait for 
bridge.
This timeout makes 'ifup br0' really slow, 1.2s in my setup.
Attached patch makes ifup snippet use 'sleep 0.01' if fractional secons are
implemented in sleep, thus making ifup much faster (0.16s as measured).

P.S: never mind the Ubuntu info, that's just the desktop I'm reporting bug from.

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-9-generic-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bridge-utils depends on:
ii  libc6                   2.10.1-0ubuntu16 GNU C Library: Shared libraries

Versions of packages bridge-utils recommends:
ii  ifupdown                   0.6.8ubuntu21 high level tools to configure netw

bridge-utils suggests no packages.

-- no debconf information
--- /var/lib/lxc/test/rootfs/usr/share/bridge-utils/ifupdown.sh 2008-08-28 
04:52:20.000000000 +0700
+++ ifupdown.sh 2010-03-07 03:45:03.650307276 +0600
@@ -213,13 +213,16 @@
   then
     /bin/echo -e "\nWaiting for $IFACE to get ready (MAXWAIT is $MAXWAIT 
seconds)."
 
+    # Use 0.01 delay if available
+    sleep 0.01 2>/dev/null && COUNT=$(($COUNT * 100))
+
     unset BREADY
     unset TRANSITIONED
     COUNT=0
 
     while [ ! "$BREADY" -a $COUNT -lt $MAXWAIT ]
     do
-      sleep 1
+      sleep 0.01 2>/dev/null || sleep 1
       COUNT=$(($COUNT+1))
       BREADY=true
       for i in $(brctl showstp $IFACE|sed -n 's/^.*port id.*state[ 
\t]*\(.*\)$/\1/p')

Reply via email to