* 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.
This commit is contained in:
Paulo Flabiano Smorigo 2013-05-11 11:25:29 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent 709ad61b07
commit a9c0b699c0
3 changed files with 10 additions and 0 deletions

View file

@ -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> 2013-05-11 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/tests/setjmp_test.c: Ignore missing noreturn. * grub-core/tests/setjmp_test.c: Ignore missing noreturn.

View file

@ -447,6 +447,9 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
ncards++; ncards++;
} }
if (ncards == 0)
return grub_error (GRUB_ERR_NET_NO_CARD, N_("no network card found"));
ifaces = grub_zalloc (ncards * sizeof (ifaces[0])); ifaces = grub_zalloc (ncards * sizeof (ifaces[0]));
if (!ifaces) if (!ifaces)
return grub_errno; return grub_errno;

View file

@ -62,6 +62,7 @@ typedef enum
GRUB_ERR_NET_ROUTE_LOOP, GRUB_ERR_NET_ROUTE_LOOP,
GRUB_ERR_NET_NO_ROUTE, GRUB_ERR_NET_NO_ROUTE,
GRUB_ERR_NET_NO_ANSWER, GRUB_ERR_NET_NO_ANSWER,
GRUB_ERR_NET_NO_CARD,
GRUB_ERR_WAIT, GRUB_ERR_WAIT,
GRUB_ERR_BUG, GRUB_ERR_BUG,
GRUB_ERR_NET_PORT_CLOSED, GRUB_ERR_NET_PORT_CLOSED,