guix/gnu
Stefan 795db9d219
gnu: qemu: Fix ioctl(…, SIOCGIFCONF, …) for emulated 64 bit architectures.
* gnu/packages/virtualization.scm (qemu): Add a snippet to fix a bug in the
do_ioctl_ifconf() function of qemu to make ioctl(…, SIOCGIFCONF, …) work for
emulated 64 bit architectures.

The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit architectures.
This structure contains a union of other structures, of which struct ifmap
is the biggest for 64 bit architectures. Calling ioctl(…, SIOCGIFCONF, …)
fills a struct sockaddr of that union, and do_ioctl_ifconf() only considered
that struct sockaddr for the size of the union, which has the same size as
struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a wrong
size of 32 for struct ifreq instead of the correct size of 40 on 64 bit
architectures.

The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part of
the union, treating struct ifreq with the correct size.

This fixes (@ (guix build syscalls) network-interface-names) when used in
emulated 64 bit architectures.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-01-14 17:15:18 +01:00
..
bootloader
build
installer installer: Fix crash in parameters menu. 2021-01-12 16:40:27 +01:00
machine
packages gnu: qemu: Fix ioctl(…, SIOCGIFCONF, …) for emulated 64 bit architectures. 2021-01-14 17:15:18 +01:00
services services: shepherd: 'shepherd-service-type' requires documentation. 2021-01-13 22:24:18 +01:00
system services: shepherd: 'shepherd-service-type' requires documentation. 2021-01-13 22:24:18 +01:00
tests
artwork.scm
bootloader.scm
ci.scm
image.scm
installer.scm installer: Fix crash in parameters menu. 2021-01-12 16:40:27 +01:00
local.mk gnu: Add ipxe. 2021-01-14 01:17:04 +01:00
machine.scm
packages.scm
services.scm
system.scm
tests.scm