From a626fdd76af12d1c77c6b798e6b4f937b1992a77 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 1 May 2012 15:29:44 +0200 Subject: [PATCH] * grub-core/net/ip.c (handle_dgram): Fix undeclared variable. --- ChangeLog | 4 ++++ grub-core/net/ip.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1a0629214..b56c00b40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-05-01 Vladimir Serbinenko + + * grub-core/net/ip.c (handle_dgram): Fix undeclared variable. + 2012-05-01 Vladimir Serbinenko * grub-core/normal/autofs.c (read_fs_list): Revert accidental wrong diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c index 131e81ee0..b0658f01a 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -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; @@ -264,12 +265,14 @@ handle_dgram (struct grub_net_buff *nb, grub_netbuff_free (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);