Add error verification in netbuff operations.

This commit is contained in:
Manoel R. Abranches 2011-06-18 20:20:53 -03:00
parent d6d205568f
commit d855fbcf37
7 changed files with 38 additions and 19 deletions

View file

@ -9,8 +9,10 @@ grub_net_send_udp_packet (const grub_net_socket_t socket,
struct grub_net_buff *nb)
{
struct udphdr *udph;
grub_err_t err;
grub_netbuff_push (nb, sizeof (*udph));
if ((err = grub_netbuff_push (nb, sizeof (*udph))) != GRUB_ERR_NONE)
return err;
udph = (struct udphdr *) nb->data;
udph->src = grub_cpu_to_be16 (socket->in_port);