From 9133e1333b2d845856ab4de020b01235abd1c509 Mon Sep 17 00:00:00 2001 From: Alin Năstac Date: Sun, 20 Sep 2009 12:58:23 +0000 Subject: Fix crash on 2.6.30 kernel (#278858). Package-Manager: portage-2.1.6.13/cvs/Linux x86_64 RepoMan-Options: --force --- net-firewall/ipp2p/ChangeLog | 9 +- net-firewall/ipp2p/Manifest | 14 +- .../ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch | 114 ---------------- .../ipp2p/files/ipp2p-0.8.2-kernel-2.6.30.patch | 149 +++++++++++++++++++++ net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild | 79 ----------- net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild | 79 +++++++++++ 6 files changed, 243 insertions(+), 201 deletions(-) delete mode 100644 net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch create mode 100644 net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.30.patch delete mode 100644 net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild create mode 100644 net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild (limited to 'net-firewall/ipp2p') diff --git a/net-firewall/ipp2p/ChangeLog b/net-firewall/ipp2p/ChangeLog index d822b765810c..a852c43903c4 100644 --- a/net-firewall/ipp2p/ChangeLog +++ b/net-firewall/ipp2p/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-firewall/ipp2p # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ChangeLog,v 1.41 2009/04/25 11:09:42 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ChangeLog,v 1.42 2009/09/20 12:58:23 mrness Exp $ + +*ipp2p-0.8.2-r5 (20 Sep 2009) + + 20 Sep 2009; Alin Năstac -ipp2p-0.8.2-r4.ebuild, + +ipp2p-0.8.2-r5.ebuild, -files/ipp2p-0.8.2-kernel-2.6.22.patch, + +files/ipp2p-0.8.2-kernel-2.6.30.patch: + Fix crash on 2.6.30 kernel (#278858). 25 Apr 2009; Alin Năstac files/ipp2p-0.8.2-iptables-1.4.3.patch: diff --git a/net-firewall/ipp2p/Manifest b/net-firewall/ipp2p/Manifest index 1163dcd47565..b899848fe0d0 100644 --- a/net-firewall/ipp2p/Manifest +++ b/net-firewall/ipp2p/Manifest @@ -4,15 +4,15 @@ Hash: SHA1 AUX ipp2p-0.8.2-iptables-1.4.0.patch 1202 RMD160 5b90d6217dd7acbe73f1fc91d8a530067cb5e4fc SHA1 0d474d3fef15013a7d5bcae7cdd058d2a942bdd0 SHA256 729c218d40bc4b6e68a954e4af7919c4235fe531aa9cc4ed93f851f851588671 AUX ipp2p-0.8.2-iptables-1.4.1.patch 1040 RMD160 ab9294b373432c75c667d05f4a3fdf0b136c0ff3 SHA1 e042f529a245faa0df7209178debfd29ece91b32 SHA256 4378a1d96296135e856b59b68142fd50127eb8619e490b5bd6a5baed44efff6d AUX ipp2p-0.8.2-iptables-1.4.3.patch 12482 RMD160 efe7b2ffe4a81b1f69ecd6726ed22deda71039f9 SHA1 64d0e0bb7f97f305b76f7590c2fa416d91b981aa SHA256 996b32c02f8ee0029f0482b473a90899491778012f8836096ba90214bf54c73c -AUX ipp2p-0.8.2-kernel-2.6.22.patch 3106 RMD160 8a088c8a72695aa59626d59253a80c78deaf72ea SHA1 8449486f8341900d0e0af783008455fc84741ba1 SHA256 90272cfa66b333d31271bd918b3879e63e3dd5681e6fd9436ba5276329618719 +AUX ipp2p-0.8.2-kernel-2.6.30.patch 4644 RMD160 4a30d1b6814c51674417c35cba0e73d01a36070f SHA1 4f46fc1b256b30fce03fbbd2c8d66ab233f22a99 SHA256 dd1b006b3bc86e994acb8c010701afab1aea201cfd60c9325accd5484b792877 DIST ipp2p-0.8.2.tar.gz 18976 RMD160 097cd4175af3f97f3687f343087b8fe0af20ba38 SHA1 98dbcf84b23e7afde3286fd0f1c1816b437d082e SHA256 b265f5a1ce62de5a6cc60b9af22134a8d19b23e14b47a897057bca91188e0ee7 -EBUILD ipp2p-0.8.2-r4.ebuild 2079 RMD160 011e0c5f9be18f0ffaf403a550e54652ab29f9e6 SHA1 065ecf77031ed8aeabc4b5279eb2269a074328d7 SHA256 24bb18187ddbe448254472982f0170e0cf0c0714db8c6ed83b11e01bd75808ea -MISC ChangeLog 6573 RMD160 e1846e34b7006fb10625e447696fb8b03d01e895 SHA1 b0ef355996d567030ea7ff4350250b6600ec8948 SHA256 975d35591b88a3a2015924598063bacaaceae5b5f61d0aa0add7baf5e9edb1b7 +EBUILD ipp2p-0.8.2-r5.ebuild 2079 RMD160 1f968bae3916a63af4d3b5cd115c58de08f1683f SHA1 0430fdea9315aee890192a8d55681fb54c614372 SHA256 775e1f87a642549dcd076546a619bbe3cf280dd8386d344d4e280b85be34df5e +MISC ChangeLog 6825 RMD160 7f356beaf40dd0e13acaa6ca6438f5d9c0cbe004 SHA1 379a6aa9b895b1b815d162a989e274c1bb14fd2b SHA256 0e67fc2f52fe89a52ef6cb9f2e143e5ec4838c5975abc845315866b68e4a941d MISC metadata.xml 773 RMD160 4e189213cb94afb5fbdcc54ddf6a8242b3721af8 SHA1 45701acbb199b7315d28fe82c8010b95f9d0f5ec SHA256 9a475f0965f36601f0a283a9d4b15f16ac28f7cc6a227ca28a980ffad548a776 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.10 (GNU/Linux) +Version: GnuPG v2.0.11 (GNU/Linux) -iEYEARECAAYFAkny738ACgkQts85UDFmaOXNXACeMhFFThipW4RmePWgBTGy83bf -orYAnR5buYnPsnleJKcpH/1JhbTPNKl3 -=m8bK +iEYEARECAAYFAkq2JvoACgkQ9A5kJBGSrssooQCfTCfB/dImFvZZLzNresdnNSxn +zbUAnjGJtATgzJcVedo4/+e8Z1Zt+b5W +=BsSZ -----END PGP SIGNATURE----- diff --git a/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch b/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch deleted file mode 100644 index 8d5b0531b104..000000000000 --- a/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch +++ /dev/null @@ -1,114 +0,0 @@ -diff -Nru ipp2p-0.8.2.orig/ipt_ipp2p.c ipp2p-0.8.2/ipt_ipp2p.c ---- ipp2p-0.8.2.orig/ipt_ipp2p.c 2007-12-04 07:50:55.000000000 +0200 -+++ ipp2p-0.8.2/ipt_ipp2p.c 2007-12-04 07:50:43.000000000 +0200 -@@ -2,9 +2,18 @@ - #include - #endif - #include --#include - #include -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) -+# include -+# define ipt_register_match xt_register_match -+# define ipt_unregister_match xt_unregister_match -+# define ipt_match xt_match -+#else -+# include - //#include -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */ -+ - #include "ipt_ipp2p.h" - #include - #include -@@ -725,7 +734,11 @@ - }; - - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -+static bool -+#else - static int -+#endif - match(const struct sk_buff *skb, - const struct net_device *in, - const struct net_device *out, -@@ -744,11 +757,19 @@ - u_int16_t datalen, - #endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -+ bool *hotdrop) -+#else - int *hotdrop) -+#endif - { - const struct ipt_p2p_info *info = matchinfo; - unsigned char *haystack; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -+ struct iphdr *ip = ip_hdr(skb); -+#else - struct iphdr *ip = skb->nh.iph; -+#endif - int p2p_result = 0, i = 0; - // int head_len; - int hlen = ntohs(ip->tot_len)-(ip->ihl*4); /*hlen = packet-data length*/ -@@ -822,7 +843,11 @@ - - - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) -+static bool -+#else - static int -+#endif - checkentry(const char *tablename, - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) - const void *ip, -@@ -831,7 +856,9 @@ - const struct ipt_ip *ip, - #endif - void *matchinfo, -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) - unsigned int matchsize, -+#endif - unsigned int hook_mask) - { - /* Must specify -p tcp */ -@@ -843,15 +870,6 @@ - } - - --// TODO: find out what this structure is for (scheme taken --// from kernel sources) --// content seems to have a length of 8 bytes --// (at least on my x86 machine) --struct ipp2p_match_info { -- long int dunno_what_this_is_for; -- long int i_also_dunno_what_this_is_for; --}; -- - static struct ipt_match ipp2p_match = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) - { NULL, NULL }, -@@ -860,17 +878,16 @@ - &checkentry, - NULL, - THIS_MODULE --#endif --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)) -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) - .name = "ipp2p", - .match = &match, - .checkentry = &checkentry, - .me = THIS_MODULE, --#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) -+#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */ - .name = "ipp2p", - .match = &match, - .family = AF_INET, -- .matchsize = sizeof(struct ipp2p_match_info), -+ .matchsize = XT_ALIGN(sizeof(struct ipt_p2p_info)), - .checkentry = &checkentry, - .me = THIS_MODULE, - #endif diff --git a/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.30.patch b/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.30.patch new file mode 100644 index 000000000000..93cbf21d2d2a --- /dev/null +++ b/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.30.patch @@ -0,0 +1,149 @@ +diff -Nru ipp2p-0.8.2.orig/ipt_ipp2p.c ipp2p-0.8.2/ipt_ipp2p.c +--- ipp2p-0.8.2.orig/ipt_ipp2p.c 2006-09-27 11:52:00.000000000 +0200 ++++ ipp2p-0.8.2/ipt_ipp2p.c 2009-09-20 14:37:00.000000000 +0200 +@@ -2,9 +2,18 @@ + #include + #endif + #include +-#include + #include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) ++# include ++# define ipt_register_match xt_register_match ++# define ipt_unregister_match xt_unregister_match ++# define ipt_match xt_match ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) */ ++# include + //#include ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) */ ++ + #include "ipt_ipp2p.h" + #include + #include +@@ -725,8 +734,15 @@ + }; + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++static bool ++#else + static int ++#endif + match(const struct sk_buff *skb, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ++ const struct xt_match_param *params ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ + const struct net_device *in, + const struct net_device *out, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +@@ -734,21 +750,36 @@ + const void *matchinfo, + int offset, + unsigned int myprotoff, +-#else ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) */ + const void *matchinfo, + int offset, +-#endif ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) */ + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) + const void *hdr, + u_int16_t datalen, + #endif + +- int *hotdrop) +-{ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++ bool *hotdrop ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */ ++ int *hotdrop ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */ ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ ++) ++{ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ++ const struct ipt_p2p_info *info = params->matchinfo; ++ const int offset = params->fragoff; ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ + const struct ipt_p2p_info *info = matchinfo; ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ + unsigned char *haystack; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++ struct iphdr *ip = ip_hdr(skb); ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */ + struct iphdr *ip = skb->nh.iph; ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */ + int p2p_result = 0, i = 0; + // int head_len; + int hlen = ntohs(ip->tot_len)-(ip->ihl*4); /*hlen = packet-data length*/ +@@ -822,8 +853,16 @@ + + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++static bool ++#else + static int +-checkentry(const char *tablename, ++#endif ++checkentry( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ++ const struct xt_mtchk_param *params ++#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ ++ const char *tablename, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) + const void *ip, + const struct xt_match *mymatch, +@@ -831,8 +870,12 @@ + const struct ipt_ip *ip, + #endif + void *matchinfo, ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) + unsigned int matchsize, +- unsigned int hook_mask) ++#endif ++ unsigned int hook_mask ++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */ ++) + { + /* Must specify -p tcp */ + /* if (ip->proto != IPPROTO_TCP || (ip->invflags & IPT_INV_PROTO)) { +@@ -843,15 +886,6 @@ + } + + +-// TODO: find out what this structure is for (scheme taken +-// from kernel sources) +-// content seems to have a length of 8 bytes +-// (at least on my x86 machine) +-struct ipp2p_match_info { +- long int dunno_what_this_is_for; +- long int i_also_dunno_what_this_is_for; +-}; +- + static struct ipt_match ipp2p_match = { + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) + { NULL, NULL }, +@@ -860,17 +894,16 @@ + &checkentry, + NULL, + THIS_MODULE +-#endif +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)) ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + .name = "ipp2p", + .match = &match, + .checkentry = &checkentry, + .me = THIS_MODULE, +-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) ++#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */ + .name = "ipp2p", + .match = &match, + .family = AF_INET, +- .matchsize = sizeof(struct ipp2p_match_info), ++ .matchsize = XT_ALIGN(sizeof(struct ipt_p2p_info)), + .checkentry = &checkentry, + .me = THIS_MODULE, + #endif diff --git a/net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild b/net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild deleted file mode 100644 index 94540e78c95c..000000000000 --- a/net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild,v 1.9 2009/04/10 22:25:36 mrness Exp $ - -EAPI="2" - -inherit linux-mod eutils - -DESCRIPTION="Netfilter module for dealing with P2P Applications." -HOMEPAGE="http://www.ipp2p.org/index_en.html" -SRC_URI="http://www.ipp2p.org/downloads/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~ppc ppc64 sparc x86" -IUSE="" - -RDEPEND="virtual/modutils - net-firewall/iptables" - -DEPEND="${RDEPEND} - virtual/linux-sources" - -pkg_setup() { - CONFIG_CHECK="NETFILTER" - NETFILTER_ERROR="Your kernel is not configured to support Netfilter." - MODULE_NAMES="ipt_ipp2p(${PN}:${S}:${S})" - - linux-mod_pkg_setup -} - -src_prepare() { - epatch "${FILESDIR}"/${P}-kernel-2.6.22.patch - convert_to_m Makefile - - sed -i -e "s/^IPTABLES_VERSION/#IPTABLES_VERSION/" Makefile - - has_version '>=net-firewall/iptables-1.3.6' || return 0 - sed -i -e "s/ld -shared/\$\(CC\) -shared/" Makefile - - has_version '>=net-firewall/iptables-1.4.0' || return 0 - epatch "${FILESDIR}"/${P}-iptables-1.4.0.patch - - has_version '>=net-firewall/iptables-1.4.1' || return 0 - epatch "${FILESDIR}"/${P}-iptables-1.4.1.patch - - has_version '>=net-firewall/iptables-1.4.3' || return 0 - epatch "${FILESDIR}"/${P}-iptables-1.4.3.patch -} - -src_compile() { - local IPTABLES_VERSION="$(/sbin/iptables --version | cut -f2 -dv)" - emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" \ - IPTABLES_SRC="/usr" IPTABLES_VERSION="${IPTABLES_VERSION}" libipt_ipp2p.so \ - || die "Failed to build iptables module" - - local myARCH="${ARCH}" - ARCH="$(tc-arch-kernel)" - emake KERNEL_SRC="${KV_DIR}" \ - IPTABLES_SRC="/usr" IPTABLES_VERSION="${IPTABLES_VERSION}" \ - || die "Failed to build kernel module." - ARCH="${myARCH}" -} - -src_install() { - if has_version '>=net-firewall/iptables-1.4.1' ; then - exeinto /$(get_libdir)/xtables - else - exeinto /$(get_libdir)/iptables - fi - doexe libipt_ipp2p.so - - dodoc README - linux-mod_src_install -} - -pkg_postinst() { - linux-mod_pkg_postinst -} diff --git a/net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild b/net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild new file mode 100644 index 000000000000..d7e9204e2715 --- /dev/null +++ b/net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ipp2p-0.8.2-r5.ebuild,v 1.1 2009/09/20 12:58:23 mrness Exp $ + +EAPI="2" + +inherit linux-mod eutils + +DESCRIPTION="Netfilter module for dealing with P2P Applications." +HOMEPAGE="http://www.ipp2p.org/index_en.html" +SRC_URI="http://www.ipp2p.org/downloads/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~ppc ppc64 sparc x86" +IUSE="" + +RDEPEND="virtual/modutils + net-firewall/iptables" + +DEPEND="${RDEPEND} + virtual/linux-sources" + +pkg_setup() { + CONFIG_CHECK="NETFILTER" + NETFILTER_ERROR="Your kernel is not configured to support Netfilter." + MODULE_NAMES="ipt_ipp2p(${PN}:${S}:${S})" + + linux-mod_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-kernel-2.6.30.patch + convert_to_m Makefile + + sed -i -e "s/^IPTABLES_VERSION/#IPTABLES_VERSION/" Makefile + + has_version '>=net-firewall/iptables-1.3.6' || return 0 + sed -i -e "s/ld -shared/\$\(CC\) -shared/" Makefile + + has_version '>=net-firewall/iptables-1.4.0' || return 0 + epatch "${FILESDIR}"/${P}-iptables-1.4.0.patch + + has_version '>=net-firewall/iptables-1.4.1' || return 0 + epatch "${FILESDIR}"/${P}-iptables-1.4.1.patch + + has_version '>=net-firewall/iptables-1.4.3' || return 0 + epatch "${FILESDIR}"/${P}-iptables-1.4.3.patch +} + +src_compile() { + local IPTABLES_VERSION="$(/sbin/iptables --version | cut -f2 -dv)" + emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" \ + IPTABLES_SRC="/usr" IPTABLES_VERSION="${IPTABLES_VERSION}" libipt_ipp2p.so \ + || die "Failed to build iptables module" + + local myARCH="${ARCH}" + ARCH="$(tc-arch-kernel)" + emake KERNEL_SRC="${KV_DIR}" \ + IPTABLES_SRC="/usr" IPTABLES_VERSION="${IPTABLES_VERSION}" \ + || die "Failed to build kernel module." + ARCH="${myARCH}" +} + +src_install() { + if has_version '>=net-firewall/iptables-1.4.1' ; then + exeinto /$(get_libdir)/xtables + else + exeinto /$(get_libdir)/iptables + fi + doexe libipt_ipp2p.so + + dodoc README + linux-mod_src_install +} + +pkg_postinst() { + linux-mod_pkg_postinst +} -- cgit v1.2.3-65-gdbad