Hi all,

This fix add a check for a network card before continue the bootp command execution.

Thanks,
--
Paulo Flabiano Smorigo
Software Engineer
Linux Technology Center - IBM Systems & Technology Group

=== modified file 'ChangeLog'
--- ChangeLog	2013-05-05 16:16:48 +0000
+++ ChangeLog	2013-05-06 15:49:29 +0000
@@ -1,3 +1,9 @@
+2013-05-06 Paulo Flabiano Smorigo <pfsmor...@br.ibm.com>
+
+	* grub-core/net/bootp.c (grub_cmd_bootp): Check if there is any card
+	present.
+	* include/grub/err.h (grub_err_t): New enum value GRUB_ERR_NET_NO_CARD.
+
 2013-05-05  Bean  <bean12...@gmail.com>
 
 	* grub-core/commands/testspeed.c: New command testspeed.

=== modified file 'grub-core/net/bootp.c'
--- grub-core/net/bootp.c	2013-01-20 13:24:47 +0000
+++ grub-core/net/bootp.c	2013-05-06 15:21:48 +0000
@@ -444,6 +444,12 @@
     ncards++;
   }
 
+  if (ncards == 0)
+    {
+      err = grub_error (GRUB_ERR_NET_NO_CARD, N_("no network card found"));
+      return err;
+    }
+
   ifaces = grub_zalloc (ncards * sizeof (ifaces[0]));
   if (!ifaces)
     return grub_errno;

=== modified file 'include/grub/err.h'
--- include/grub/err.h	2013-01-11 20:32:42 +0000
+++ include/grub/err.h	2013-05-06 15:21:48 +0000
@@ -62,6 +62,7 @@
     GRUB_ERR_NET_ROUTE_LOOP,
     GRUB_ERR_NET_NO_ROUTE,
     GRUB_ERR_NET_NO_ANSWER,
+    GRUB_ERR_NET_NO_CARD,
     GRUB_ERR_WAIT,
     GRUB_ERR_BUG,
     GRUB_ERR_NET_PORT_CLOSED,

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to