]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/net/bootp.c (grub_cmd_bootp): Check if there is any card
authorPaulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Sat, 11 May 2013 09:25:29 +0000 (11:25 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 11 May 2013 09:25:29 +0000 (11:25 +0200)
present.
* include/grub/err.h (grub_err_t): New enum value GRUB_ERR_NET_NO_CARD.

ChangeLog
grub-core/net/bootp.c
include/grub/err.h

index 0dedc844b222ebbb037e3eb58456d5bc85361e53..bbaed8412d3d7b088ee800c2446bc5d6f104355f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-05-11  Paulo Flabiano Smorigo <pfsmorigo@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-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/tests/setjmp_test.c: Ignore missing noreturn.
index c8ef4d662bfb18ba28e579bed9c8b387795f4e8e..e0ab47e129af1edd0ac7bd33c3a7112c29e38165 100644 (file)
@@ -447,6 +447,9 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
     ncards++;
   }
 
+  if (ncards == 0)
+    return grub_error (GRUB_ERR_NET_NO_CARD, N_("no network card found"));
+
   ifaces = grub_zalloc (ncards * sizeof (ifaces[0]));
   if (!ifaces)
     return grub_errno;
index 0f9b208308eebe40f8b0c08381f2ba9874442f61..9896fccf98adef1b11db6b4d9ea13e2b18d268b3 100644 (file)
@@ -62,6 +62,7 @@ typedef enum
     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,