Add error verification in netbuff operations.
This commit is contained in:
parent
d6d205568f
commit
d855fbcf37
7 changed files with 38 additions and 19 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue