* grub-core/net/ip.c (handle_dgram): Fix undeclared variable.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-05-01 15:29:44 +02:00
parent b2f6847735
commit a626fdd76a
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2012-05-01 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/net/ip.c (handle_dgram): Fix undeclared variable.
2012-05-01 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/autofs.c (read_fs_list): Revert accidental wrong

View file

@ -237,6 +237,7 @@ handle_dgram (struct grub_net_buff *nb,
udph = (struct udphdr *) nb->data;
if (proto == GRUB_NET_IP_UDP && grub_be_to_cpu16 (udph->dst) == 68)
{
const struct grub_net_bootp_packet *bootp;
if (udph->chksum)
{
grub_uint16_t chk, expected;
@ -265,11 +266,13 @@ handle_dgram (struct grub_net_buff *nb,
return err;
}
bootp = (const struct grub_net_bootp_packet *) nb->data;
FOR_NET_NETWORK_LEVEL_INTERFACES (inf)
if (inf->card == card
&& inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV
&& inf->hwaddress.type == GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET
&& grub_memcmp (inf->hwaddress.mac, &dhcp->mac_addr,
&& grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr,
sizeof (inf->hwaddress.mac)) == 0)
{
grub_net_process_dhcp (nb, inf->card);