[PATCH 2/5] Give the kernel some time to up interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It does not really matter if the kernel needs some time or if
the ethernet handshake takes a while. It's a good idea to wait
a second after upping an interface to let things settle.
---
 modules.d/40network/dhclient-script |    2 ++
 modules.d/40network/ifup            |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules.d/40network/dhclient-script b/modules.d/40network/dhclient-script
index 5b36a40..9e7eefd 100755
--- a/modules.d/40network/dhclient-script
+++ b/modules.d/40network/dhclient-script
@@ -52,6 +52,8 @@ netif=$interface
 case $reason in
     PREINIT)
 	ip link set $netif up
+	# Give the kernel some time to up the interface
+	sleep 1
 	;;
     BOUND)
 	setup_interface 
diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup
index 89017bb..174edca 100755
--- a/modules.d/40network/ifup
+++ b/modules.d/40network/ifup
@@ -32,8 +32,9 @@ do_dhcp() {
 
 # Handle static ip configuration
 do_static() {
-{
+    {
 	echo ip link set $netif up 
+	echo sleep 1
 	echo ip addr flush dev $netif
 	echo ip addr add $ip/$mask dev $netif
     } > /tmp/net.$netif.up
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux