62e3547e57
- Version bump to 2.04 * removed - translations-20170427.tar.xz * grub2.spec - Make signed grub-tpm.efi specific to x86_64-efi build, the platform currently shipped with tpm module from upstream codebase - Add shim_lock to signed grub.efi in x86_64-efi build - x86_64: linuxefi now depends on linux, both will verify kernel via shim_lock - Remove translation tarball and po file hacks as it's been included in upstream tarball * rediff - grub2-setup-try-fs-embed-if-mbr-gap-too-small.patch - grub2-commands-introduce-read_file-subcommand.patch - grub2-secureboot-add-linuxefi.patch - 0001-add-support-for-UEFI-network-protocols.patch - grub2-efi-HP-workaround.patch - grub2-secureboot-install-signed-grub.patch - grub2-linux.patch - use-grub2-as-a-package-name.patch - grub2-pass-corret-root-for-nfsroot.patch - grub2-secureboot-use-linuxefi-on-uefi.patch - grub2-secureboot-no-insmod-on-sb.patch - grub2-secureboot-provide-linuxefi-config.patch - grub2-secureboot-chainloader.patch - grub2-s390x-01-Changes-made-and-files-added-in-order-to-allow-s390x.patch - grub2-s390x-02-kexec-module-added-to-emu.patch - grub2-s390x-04-grub2-install.patch - grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch - grub2-efi-chainloader-root.patch OBS-URL: https://build.opensuse.org/request/show/741033 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=340
42 lines
2.1 KiB
Diff
42 lines
2.1 KiB
Diff
From: Masahiro Matsuya <mmatsuya@redhat.com>
|
|
|
|
The netmask configured in firmware is not respected on ppc64 (big endian).
|
|
When 255.255.252.0 is set as netmask in firmware, the following is the value of bootpath string in grub_ieee1275_parse_bootpath().
|
|
|
|
/vdevice/l-lan@30000002:speed=auto,duplex=auto,192.168.88.10,,192.168.89.113,192.168.88.1,5,5,255.255.252.0,512
|
|
|
|
The netmask in this bootpath is no problem, since it's a value specified in firmware. But,
|
|
The value of 'subnet_mask.ipv4' was set with 0xfffffc00, and __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4)) returned 16 (not 22).
|
|
As a result, 16 was used for netmask wrongly.
|
|
|
|
1111 1111 1111 1111 1111 1100 0000 0000 # subnet_mask.ipv4 (=0xfffffc00)
|
|
0000 0000 1111 1100 1111 1111 1111 1111 # grub_le_to_cpu32 (subnet_mask.ipv4)
|
|
1111 1111 0000 0011 0000 0000 0000 0000 # ~grub_le_to_cpu32 (subnet_mask.ipv4)
|
|
|
|
And, the count of zero with __builtin_ctz can be 16.
|
|
This patch changes it as below.
|
|
|
|
1111 1111 1111 1111 1111 1100 0000 0000 # subnet_mask.ipv4 (=0xfffffc00)
|
|
0000 0000 1111 1100 1111 1111 1111 1111 # grub_le_to_cpu32 (subnet_mask.ipv4)
|
|
1111 1111 1111 1111 1111 1100 0000 0000 # grub_swap_bytes32(grub_le_to_cpu32 (subnet_mask.ipv4))
|
|
0000 0000 0000 0000 0000 0011 1111 1111 # ~grub_swap_bytes32(grub_le_to_cpu32 (subnet_mask.ipv4))
|
|
|
|
The count of zero with __builtin_clz can be 22. (clz counts the number of one bits preceding the most significant zero bit)
|
|
---
|
|
grub-core/net/drivers/ieee1275/ofnet.c | 2 +-
|
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
Index: grub-2.04~rc1/grub-core/net/drivers/ieee1275/ofnet.c
|
|
===================================================================
|
|
--- grub-2.04~rc1.orig/grub-core/net/drivers/ieee1275/ofnet.c
|
|
+++ grub-2.04~rc1/grub-core/net/drivers/ieee1275/ofnet.c
|
|
@@ -220,7 +220,7 @@ grub_ieee1275_parse_bootpath (const char
|
|
flags);
|
|
inter->vlantag = vlantag;
|
|
grub_net_add_ipv4_local (inter,
|
|
- __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4)));
|
|
+ __builtin_clz (~ (subnet_mask.ipv4)));
|
|
|
|
}
|
|
|