aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStefan <stefan-guix@vodafonemail.de>2021-01-11 21:32:47 +0100
committerLudovic Courtès <ludo@gnu.org>2021-01-14 17:15:18 +0100
commit795db9d2199200e69d0acc7ffad4546a75679f95 (patch)
tree79ba8c3b3466b65d9385ee2e156806ff1c1fc791 /scripts
parent4f38e0e47b4f20d5fa034ec7cde836858cfc7963 (diff)
downloadguix-795db9d2199200e69d0acc7ffad4546a75679f95.tar.gz
guix-795db9d2199200e69d0acc7ffad4546a75679f95.zip
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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions