Hello, Doug Evans, le ven. 05 mars 2021 17:00:13 -0800, a ecrit: > Is it possible for QEMU to lazily determine the guest's IPv6 > address? I.e., postpone the ""->guest address mapping until it's > needed and then, say, take the first entry in the NDP table?
That would probably be possible, yes, by moving the if (!guest_addr.s_addr) { guest_addr = slirp->vdhcp_startaddr; } from slirp_add_hostfwd() and alike to tcp_connect() and sorecvfrom() (along the other sotranslate call). > That feels a bit fragile: what if someone else gets the first entry in > the NDP table? But is that any more fragile than assuming the first > handed out DHCP address is to the guest? I don't think it's really more fragile. > [<<-- Honest question, can we assume the first handed out DHCP address > will necessarily be the guest?] It "cannot" be anything else. What could happen is a PXE loader that uses DHCP/NDP, and then the OS that does it again. > But that would mean the defaults for the guest would have to be > different than for the host. E.g., > host: ",ipv4" means both, Why would it mean both? I don't follow you here. > whereas guest: ",ipv4" (ideally) means ipv4 (since both is meaningless) Samuel