---- Ed Swierk <[EMAIL PROTECTED]> wrote: 
> On 5/1/06, Fabrice Bellard <[EMAIL PROTECTED]> wrote:
> I am not sure this patch is sufficient: sometimes our_addr is used to
> open socket on the host side and 10.0.2.2 has a meanning only on the VM
> side.

Indeed, our_addr seems to be used for two distinct purposes:

- application protocol emulation code (like udp_emu() in udp.c) uses
the "host" address for opening sockets on the host; I'm not familiar
with the details of these protocols, but in any event it must be some
address that is meaningful to applications running on the host side;

- elsewhere in slirp, the "alias" address (10.0.2.2) is used to
rewrite the source address of packets originating from the host to the
VM; this address makes sense only within the VM.

The attached patch adds a new global, alias_addr, that is set to
10.0.2.2 and replaces our_addr in the latter cases. The patch also
changes getouraddr() so that it always returns either a "real" address
(as determined by gethostbyname(gethostname()) or 127.0.0.1, but never
10.0.2.2.

--Ed

Am I seeing a problem in line 98 of slirp/misc.c? The line above reads:

if (our_addr.s_addr == 0)
  our_addr.s_addr == loopback_addr.s_addr: 

Shouldn't that be "our_addr.s_addr = loopback_addr.s_addr;"   (Single =)

Ben


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to