ports/91358: two additional slirp patches for emulators/qemu
Juergen Lock
nox at jelal.kn-bremen.de
Thu Jan 5 21:10:08 UTC 2006
>Number: 91358
>Category: ports
>Synopsis: two additional slirp patches for emulators/qemu
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 05 21:10:05 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Juergen Lock
>Release: FreeBSD 5.3-RELEASE-p20 i386
>Organization:
me? organized??
>Environment:
System: FreeBSD saturn 5.3-RELEASE-p20 FreeBSD 5.3-RELEASE-p20 #1: Sat Dec 24 16:52:03 CET 2005 nox at saturn:/usr/home/nox/src5/usr/src/sys/i386/compile/NEPTUN i386
>Description:
Apply two additional slirp patches from the mailing list
(and quiet WITH_HACKS patching):
http://lists.gnu.org/archive/html/qemu-devel/2005-12/msg00277.html
(-> files/patch-slirp-nat)
http://lists.gnu.org/archive/html/qemu-devel/2005-05/msg00228.html
(-> files/patch-slirp-mbuf.c)
>How-To-Repeat:
n/a
>Fix:
New files: files/patch-slirp-nat, files/patch-slirp-mbuf.c
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.42
diff -u -r1.42 Makefile
--- Makefile 31 Dec 2005 00:12:20 -0000 1.42
+++ Makefile 5 Jan 2006 20:32:35 -0000
@@ -7,7 +7,7 @@
PORTNAME= qemu
PORTVERSION= 0.8.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= http://www.qemu.org/:release \
http://people.fruitsalad.org/nox/qemu/:snapshot \
@@ -83,7 +83,7 @@
post-patch:
.if defined(WITH_HACKS)
- @cd ${WRKDIR} ; ${TAR} xvfz ${DISTDIR}/${DIST_SUBDIR}/qemu_dma_patch.tar.gz ; ${CP} new_qemu_dma_patch/bios.bin ${WRKSRC}/pc-bios; cd ${WRKSRC}; ${PATCH} -p1 < ../new_qemu_dma_patch/qemu-piix4-udma.patch
+ @cd ${WRKDIR} ; ${TAR} xvfz ${DISTDIR}/${DIST_SUBDIR}/qemu_dma_patch.tar.gz ; ${CP} new_qemu_dma_patch/bios.bin ${WRKSRC}/pc-bios; cd ${WRKSRC}; ${PATCH} --quiet -p1 < ../new_qemu_dma_patch/qemu-piix4-udma.patch
.endif
post-install:
Index: files/patch-slirp-nat
@@ -0,0 +1,56 @@
+# http://lists.gnu.org/archive/html/qemu-devel/2005-12/msg00277.html
+
+diff -wurb qemu/slirp/misc.c qemu-patched/slirp/misc.c
+--- qemu/slirp/misc.c Sun Dec 12 12:45:10 2004
++++ qemu-patched/slirp/misc.c Mon Mar 21 13:22:05 2005
+@@ -90,13 +90,12 @@
+ char buff[256];
+ struct hostent *he;
+
+- if (gethostname(buff,256) < 0)
+- return;
+-
+- if ((he = gethostbyname(buff)) == NULL)
+- return;
+-
++ if (gethostname(buff,256) == 0)
++ if ((he = gethostbyname(buff)) != NULL)
+ our_addr = *(struct in_addr *)he->h_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
+diff -wurb qemu/slirp/slirp.c qemu-patched/slirp/slirp.c
+--- qemu/slirp/slirp.c Fri Oct 8 01:27:35 2004
++++ qemu-patched/slirp/slirp.c Mon Mar 21 13:22:05 2005
+@@ -144,7 +144,6 @@
+ m_init();
+
+ /* set default addresses */
+- getouraddr();
+ inet_aton("127.0.0.1", &loopback_addr);
+
+ if (get_dns_addr(&dns_addr) < 0) {
+@@ -153,6 +152,7 @@
+ }
+
+ inet_aton(CTL_SPECIAL, &special_addr);
++ getouraddr();
+ }
+
+ #define CONN_CANFSEND(so) (((so)->so_state & (SS_FCANTSENDMORE|SS_ISFCONNECTED)) == SS_ISFCONNECTED)
+diff -wurb qemu/slirp/udp.c qemu-patched/slirp/udp.c
+--- qemu/slirp/udp.c Fri Oct 8 01:27:35 2004
++++ qemu-patched/slirp/udp.c Mon Mar 21 13:22:05 2005
+@@ -314,6 +314,8 @@
+ saddr = *addr;
+ if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr)
+ saddr.sin_addr.s_addr = so->so_faddr.s_addr;
++ if ((so->so_faddr.s_addr & htonl(0x000000ff)) == htonl(0xff))
++ saddr.sin_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS);
+ daddr.sin_addr = so->so_laddr;
+ daddr.sin_port = so->so_lport;
+
+
Index: files/patch-slirp-mbuf.c
@@ -0,0 +1,26 @@
+# http://lists.gnu.org/archive/html/qemu-devel/2005-05/msg00228.html
+
+Index: qemu/slirp/mbuf.c
+@@ -146,18 +146,19 @@
+ struct mbuf *m;
+ int size;
+ {
++ int datasize;
++
+ /* some compiles throw up on gotos. This one we can fake. */
+ if(m->m_size>size) return;
+
+ if (m->m_flags & M_EXT) {
+- /* datasize = m->m_data - m->m_ext; */
++ datasize = m->m_data - m->m_ext;
+ m->m_ext = (char *)realloc(m->m_ext,size);
+ /* if (m->m_ext == NULL)
+ * return (struct mbuf *)NULL;
+ */
+- /* m->m_data = m->m_ext + datasize; */
++ m->m_data = m->m_ext + datasize;
+ } else {
+- int datasize;
+ char *dat;
+ datasize = m->m_data - m->m_dat;
+ dat = (char *)malloc(size);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list