[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/1] grub: fix hang in netboot
From: |
Ram Pai |
Subject: |
[PATCH 1/1] grub: fix hang in netboot |
Date: |
Thu, 24 Apr 2014 15:07:33 -0700 |
User-agent: |
Mutt/1.5.20 (2009-12-10) |
Grub can busy-loop and hang while network booting, if the network has
some fair amount of activity. This is because grub's net module sniffs
the network for packets, and busy-loops in receive_packets() till it
finds network packet of type IP or IPV6. During this period grub will
not respond to any user input, thus hanging up the system.
The following patch lets grub to relax every few iterations, so that it
can respond to other user inputs.
Signed-off-by: Ram Pai <address@hidden>
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 0e57e93..4b316fa 100644
--- a/grub-2.02~beta2/grub-core/net/net.c
+++ b/grub-2.02~beta2/grub-core/net/net.c
@@ -1500,10 +1500,11 @@ grub_net_poll_cards_idle_real (void)
FOR_NET_CARDS (card)
{
grub_uint64_t ctime = grub_get_time_ms ();
+ int stop_condition = 1;
if (ctime < card->last_poll
|| ctime >= card->last_poll + card->idle_poll_delay_ms)
- receive_packets (card, 0);
+ receive_packets (card, &stop_condition);
}
grub_net_tcp_retransmit ();
}
- [PATCH 1/1] grub: fix hang in netboot,
Ram Pai <=