From 5e6f0b32f7697259c2203d66df251aa86e55ad9b Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 21 Jan 2014 10:49:39 -0200 Subject: change stop condition to avoid infinite loops In net/net.c there is a while (1) that only exits if there is a stop condition and more then 10 packages or if there is no package received. If GRUB is idle and enter in this loop, the only condition to leave is if it doesn't have incoming packages. In a network with heavy traffic this never happens. Origin: upstream, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=d99d2f84166b0f60673d5c0714605a153946c0fc Bug-Ubuntu: https://bugs.launchpad.net/bugs/1314134 Last-Update: 2014-04-29 Patch-Name: net-receive-packets-yield.patch --- grub-core/net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 0e57e93..56355f3 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1453,7 +1453,7 @@ receive_packets (struct grub_net_card *card, int *stop_condition) } card->opened = 1; } - while (1) + while (received < 100) { /* Maybe should be better have a fixed number of packets for each card and just mark them as used and not used. */