diff options
author | edwin <edwin@FreeBSD.org> | 2006-01-06 06:21:14 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2006-01-06 06:21:14 +0800 |
commit | 9c54e745b99b6f7e4e69615029208ffac88cf07e (patch) | |
tree | 6d6261557540d801359159fe295f11a2c7825cfe /emulators | |
parent | 744ae73bc1cbb1c0bc2d35b043740dec1e72a31f (diff) | |
download | freebsd-ports-gnome-9c54e745b99b6f7e4e69615029208ffac88cf07e.tar.gz freebsd-ports-gnome-9c54e745b99b6f7e4e69615029208ffac88cf07e.tar.zst freebsd-ports-gnome-9c54e745b99b6f7e4e69615029208ffac88cf07e.zip |
two additional slirp patches for emulators/qemu
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)
PR: ports/91358
Submitted by: Juergen Lock <nox@jelal.kn-bremen.de>
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/qemu-devel/Makefile | 4 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-slirp-mbuf.c | 26 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-slirp-nat | 56 | ||||
-rw-r--r-- | emulators/qemu/Makefile | 4 | ||||
-rw-r--r-- | emulators/qemu/files/patch-slirp-mbuf.c | 26 | ||||
-rw-r--r-- | emulators/qemu/files/patch-slirp-nat | 56 |
6 files changed, 168 insertions, 4 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index c4e701205973..a9460fd6e0fa 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -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 @@ pre-patch: 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: diff --git a/emulators/qemu-devel/files/patch-slirp-mbuf.c b/emulators/qemu-devel/files/patch-slirp-mbuf.c new file mode 100644 index 000000000000..1bd32d6ad7dc --- /dev/null +++ b/emulators/qemu-devel/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); diff --git a/emulators/qemu-devel/files/patch-slirp-nat b/emulators/qemu-devel/files/patch-slirp-nat new file mode 100644 index 000000000000..9c1accaeaf83 --- /dev/null +++ b/emulators/qemu-devel/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; + + diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index c4e701205973..a9460fd6e0fa 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -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 @@ pre-patch: 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: diff --git a/emulators/qemu/files/patch-slirp-mbuf.c b/emulators/qemu/files/patch-slirp-mbuf.c new file mode 100644 index 000000000000..1bd32d6ad7dc --- /dev/null +++ b/emulators/qemu/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); diff --git a/emulators/qemu/files/patch-slirp-nat b/emulators/qemu/files/patch-slirp-nat new file mode 100644 index 000000000000..9c1accaeaf83 --- /dev/null +++ b/emulators/qemu/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; + + |