-redir revisited
PATCH 1/1 -redir revisited
Hello list,
i am recently working on integrating the -redir option into [Kju:] for Mac OS X and tested Apache access in debian guest from Mac OS X host which not worked for me. I discovered a discussion on the list in November 2005 where a patch was submitted against this (http://lists.gnu.org/archive/html/qemu-devel/2005-11/msg00419.html).
I researched current qemu cvs and found out that the patch was integrated not complete but to 95%. There are two lines in slirp/misc.c that need a change (patch attached). Tested to work with Mac OS X host and debian guest i could reach the Apache running inside the guest via localhost:8080 with the appropriate -redir command.
Greetings, cordney*
misc.c 2006-06-05 14:17:25.000000000 +0200 renamed from misc.c.orig 2006-06-05 14:12:10.000000000 +0200 +2 -2
@@ -94,8 +94,8 @@ he = gethostbyname(buff); if (he) our_addr = *(struct in_addr *)he->h_addr; - if (our_addr.s_addr == 0) - our_addr.s_addr = loopback_addr.s_addr; + if (our_addr.s_addr == 0 || our_addr.s_addr == loopback_addr.s_addr) + our_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS); } #if SIZEOF_CHAR_P == 8
Hi,
The current behaviour of QEMU seems correct to me: TCP connections coming localhost are seen coming from 10.0.2.2 on the guest. Your problem may be related to an incorrect Apache configuration. Did I miss something ?
Regards,
Fabrice.
Quoted 15 lines · René Korthaus
Hello list,
i am recently working on integrating the -redir option into [Kju:] for Mac OS X and tested Apache access in debian guest from Mac OS X host which not worked for me. I discovered a discussion on the list in November 2005 where a patch was submitted against this (http:// lists.gnu.org/archive/html/qemu-devel/2005-11/msg00419.html).
I researched current qemu cvs and found out that the patch was integrated not complete but to 95%. There are two lines in slirp/
misc.cthat need a change (patch attached). Tested to work with Mac OS X host and debian guest i could reach the Apache running inside the guest via localhost:8080 with the appropriate -redir command.Greetings, cordney*
------------------------------------------------------------------------
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Am 14.06.2006 um 15:57 schrieb Fabrice Bellard:
Quoted 3 lines
Hi,
The current behaviour of QEMU seems correct to me: TCP connections coming localhost are seen coming from 10.0.2.2 on the guest. Your problem may be related to an incorrect Apache configuration. Did I miss something ?
No, Apache is configured correctly. The same with sshd, i can only connect to the guest by applying the patch. Network configuration is given by Qemu DHCP. Without the patch the host simply gets no answer from the guest service.
Maybe this is Mac OS X specific?
Regards, cordney*
Quoted 17 lines
Regards,
Fabrice.
Quoted 10 lines · René Korthaus
Hello list,
i am recently working on integrating the -redir option into [Kju:] for Mac OS X and tested Apache access in debian guest from Mac OS X host which not worked for me. I discovered a discussion on the list in November 2005 where a patch was submitted against this (http:// lists.gnu.org/archive/html/qemu-devel/2005-11/msg00419.html). I researched current qemu cvs and found out that the patch was integrated not complete but to 95%. There are two lines in slirp/misc.cthat need a change (patch attached). Tested to work with Mac OS X host and debian guest i could reach the Apache running inside the guest via localhost:8080 with the appropriate -redir command. Greetings, cordney*
---------------------------------------------------------------------
---
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Quoted 11 lines · René Korthaus
Am 14.06.2006 um 15:57 schrieb Fabrice Bellard:
Quoted 3 lines
Hi,
The current behaviour of QEMU seems correct to me: TCP connections coming localhost are seen coming from 10.0.2.2 on the guest. Your problem may be related to an incorrect Apache configuration. Did I miss something ?
No, Apache is configured correctly. The same with sshd, i can only connect to the guest by applying the patch. Network configuration is given by Qemu DHCP. Without the patch the host simply gets no answer from the guest service.
Maybe this is Mac OS X specific?
You should launch a tcpdump inside the guest OS and look at the IP addresses associated to the IP packets when you do a telnet from the host on the redirected host port.
In any case, the patch you indicate is incorrect (our_addr is an IP address on the host network, not on the guest network), so a better solution must be found.
Fabrice.
Quoted 5 lines · René Korthaus
I researched current qemu cvs and found out that the patch was integrated not complete but to 95%. There are two lines in slirp/
misc.cthat need a change (patch attached). Tested to work with Mac OS X host and debian guest i could reach the Apache running inside the guest via localhost:8080 with the appropriate -redir command.
It looks like kju: is based on qemu 0.8.0, which definitely had the bug you found. However, this was fixed in 0.8.1. Did you try a current version of qemu (0.8.1 or cvs) without your patch?
I'm having trouble seeing how your patch could help solve the redir problem, since as far as I can tell, our_addr is no longer used for anything at all. Grepping for our_addr comes up with a buch of hits that are either #if 0'ed or irrelevant (e.g. get_dns_addr, which references our_addr before our_addr has been set).
--Ed
Am 14.06.2006 um 21:53 schrieb Ed Swierk:
Quoted 10 lines · René Korthaus
Quoted 5 lines
I researched current qemu cvs and found out that the patch was integrated not complete but to 95%. There are two lines in slirp/
misc.cthat need a change (patch attached). Tested to work with Mac OS X host and debian guest i could reach the Apache running inside the guest via localhost:8080 with the appropriate -redir command.It looks like kju: is based on qemu 0.8.0, which definitely had the bug you found. However, this was fixed in 0.8.1. Did you try a current version of qemu (0.8.1 or cvs) without your patch?
Yes, indeed, cvs worked. I didn't get that patch on the list... Thanks for your help! Patch is withdrawn...
Quoted 6 lines
I'm having trouble seeing how your patch could help solve the redir problem, since as far as I can tell,
our_addris no longer used for anything at all. Grepping forour_addrcomes up with a buch of hits that are either #if 0'ed or irrelevant (e.g.get_dns_addr, which referencesour_addrbeforeour_addrhas been set).
This was just copy&paste from the patch of November 2005 I mentioned before.
Quoted 6 lines
--Ed
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel