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 <[email protected]>
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 ();
}
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel