diff --git a/debian/changelog b/debian/changelog index 65815e3c5..0fc4749e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ grub2 (2.00-7) UNRELEASED; urgency=low * Backport from upstream: - Fix stderr leakage from grub-probe in is_path_readable_by_grub. + - Fix tftp endianness problem. -- Colin Watson Wed, 26 Sep 2012 13:16:52 +0100 diff --git a/debian/patches/series b/debian/patches/series index 27a67a786..8dc28074d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -24,3 +24,4 @@ mkconfig_ubuntu_recovery.patch msdos_embed_off_by_one.patch emu_freebsd.patch mkconfig_stderr_handling.patch +tftp_endianness.patch diff --git a/debian/patches/tftp_endianness.patch b/debian/patches/tftp_endianness.patch new file mode 100644 index 000000000..148f15fcf --- /dev/null +++ b/debian/patches/tftp_endianness.patch @@ -0,0 +1,29 @@ +Description: Fix tftp endianness problem +Author: Vladimir Serbinenko +Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4548 +Forwarded: not-needed +Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4548 +Last-Update: 2012-09-26 + +Index: b/grub-core/net/tftp.c +=================================================================== +--- a/grub-core/net/tftp.c ++++ b/grub-core/net/tftp.c +@@ -143,7 +143,7 @@ + + tftph_ack = (struct tftphdr *) nb_ack.data; + tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK); +- tftph_ack->u.ack.block = block; ++ tftph_ack->u.ack.block = grub_cpu_to_be16 (block); + + err = grub_net_send_udp_packet (data->sock, &nb_ack); + if (err) +@@ -225,7 +225,7 @@ + grub_priority_queue_pop (data->pq); + + if (file->device->net->packs.count < 50) +- err = ack (data, tftph->u.data.block); ++ err = ack (data, data->block + 1); + else + { + file->device->net->stall = 1; diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index 9c70efbec..d0f39ea36 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -143,7 +143,7 @@ ack (tftp_data_t data, grub_uint16_t block) tftph_ack = (struct tftphdr *) nb_ack.data; tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK); - tftph_ack->u.ack.block = block; + tftph_ack->u.ack.block = grub_cpu_to_be16 (block); err = grub_net_send_udp_packet (data->sock, &nb_ack); if (err) @@ -225,7 +225,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)), grub_priority_queue_pop (data->pq); if (file->device->net->packs.count < 50) - err = ack (data, tftph->u.data.block); + err = ack (data, data->block + 1); else { file->device->net->stall = 1;