SLOF/lib
Thomas Huth 273d9ce14b libnet: Correctly re-initialize the "ip_version" variable each time
I recently noticed that if you start QEMU with two NICs, and only
want to boot from the second NIC, SLOF only tries to get an IP
address via DHCPv6 instead of trying both, DHCPv4 and DHCPv6. For
example:

$ qemu-system-ppc64 -nic hubport,hubid=1 \
    -nic user,model=virtio,tftp=/.../tftp,bootfile=zImage.pseries
[...]
Trying to load:  from: /vdevice/l-lan@71000002 ...
 Initializing NIC
  Reading MAC address from device: 52:54:00:12:34:56
  Requesting information via DHCP:  007
Aborted

E3001 (net) Could not get IP address
Trying to load:  from: /pci@800000020000000/ethernet@0 ...
 Initializing NIC
  Reading MAC address from device: 52:54:00:12:34:57
  Requesting information via DHCPv6: done
  Using IPv6 address: fec0::5254:ff:fe12:3457

The problem is that we never re-initialize the "ip_version" variable
anymore, so once it has been set to 6, it stays at 6 for the second
network boot attempt, too. Thus reset the variable to 4 at the beginning
of the netload() function.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2019-04-10 16:03:00 +10:00
..
libbases Fix js2x build 2013-06-27 19:31:42 +10:00
libbcm Include make.rules in the library Makefiles 2015-03-23 11:43:20 +11:00
libbootmenu A new SLOF boot menu 2017-06-08 16:14:21 +10:00
libbootmsg libbootmsg: Do not use '\b' characters when printing checkpoints 2016-02-24 20:26:41 +11:00
libc libc: Add a simple implementation of an assert() function 2018-06-07 16:38:42 +10:00
libe1k Include make.rules in the library Makefiles 2015-03-23 11:43:20 +11:00
libelf libelf: Add REL32 to the list of ignored relocations 2018-07-02 14:16:20 +10:00
libhvcall broken_sc1: check for H_PRIVILEGE 2018-04-04 12:34:45 +10:00
libipmi JS2x: Added oco files to be able to built board-js2x 2011-12-20 17:56:48 +01:00
libnativeio Move MMIO accessors to board-js2x and implement h-calls based ones for qemu 2011-10-12 13:20:00 +02:00
libnet libnet: Correctly re-initialize the "ip_version" variable each time 2019-04-10 16:03:00 +10:00
libnvram rtas-nvram: optimize erase 2016-05-19 13:53:32 +10:00
libusb usb-xhci: Reset ERSTSZ together with ERSTBA 2017-09-12 12:53:36 +10:00
libveth Include make.rules in the library Makefiles 2015-03-23 11:43:20 +11:00
libvirtio libvirtio: Mark struct virtio_scsi_req_cmd as packed 2017-12-11 15:32:12 +11:00
Makefile lib/Makefile: Pass FLAG to make in SUBDIRS target 2017-06-28 13:13:38 +10:00