]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
change stop condition to avoid infinite loops
authorPaulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Tue, 21 Jan 2014 12:49:39 +0000 (10:49 -0200)
committerPaulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Tue, 21 Jan 2014 12:54:49 +0000 (10:54 -0200)
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.

ChangeLog
grub-core/net/net.c

index 10abfe28f20a249323767f4a0769b518067e220e..f69d8c7e0428ae103461f5c39293336fcb363fde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-01-21  Paulo Flabiano Smorigo  <pfsmorigo@br.ibm.com>
+
+       * grub-core/net/net.c (receive_packets): 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.
+
 2014-01-19  Colin Watson  <cjwatson@ubuntu.com>
 
        * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore
index 0e57e93e8218f6e7830d258e30420131e5b97a51..56355f3c98c0f9f99fdc644fd38a610677cc3196 100644 (file)
@@ -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.  */