summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2007-07-11 05:04:26 +0000
committerAlin Năstac <mrness@gentoo.org>2007-07-11 05:04:26 +0000
commit98e18567ced16387c39ecd60fe73d4288b7d9442 (patch)
tree2227d11622f2b9a05356f27300b0ad5688287a86 /net-firewall
parentwhitespace (diff)
downloadgentoo-2-98e18567ced16387c39ecd60fe73d4288b7d9442.tar.gz
gentoo-2-98e18567ced16387c39ecd60fe73d4288b7d9442.tar.bz2
gentoo-2-98e18567ced16387c39ecd60fe73d4288b7d9442.zip
Fix broken compilation against kernel 2.6.22, thanks to Yakov Suraev <j2melinux at gmail dot com> (#184808).
(Portage version: 2.1.2.7)
Diffstat (limited to 'net-firewall')
-rw-r--r--net-firewall/ipp2p/ChangeLog9
-rw-r--r--net-firewall/ipp2p/files/digest-ipp2p-0.8.2-r43
-rw-r--r--net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch82
-rw-r--r--net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild67
4 files changed, 160 insertions, 1 deletions
diff --git a/net-firewall/ipp2p/ChangeLog b/net-firewall/ipp2p/ChangeLog
index 1dacb356397f..1c50b7921240 100644
--- a/net-firewall/ipp2p/ChangeLog
+++ b/net-firewall/ipp2p/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-firewall/ipp2p
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ChangeLog,v 1.29 2007/06/19 20:12:13 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/ipp2p/ChangeLog,v 1.30 2007/07/11 05:04:26 mrness Exp $
+
+*ipp2p-0.8.2-r4 (11 Jul 2007)
+
+ 11 Jul 2007; Alin Năstac <mrness@gentoo.org>
+ +files/ipp2p-0.8.2-kernel-2.6.22.patch, +ipp2p-0.8.2-r4.ebuild:
+ Fix broken compilation against kernel 2.6.22, thanks to Yakov Suraev
+ <j2melinux at gmail dot com> (#184808).
19 Jun 2007; Alin Năstac <mrness@gentoo.org>
-files/ipp2p-0.8.2-matchsize.patch, -ipp2p-0.8.2-r2.ebuild:
diff --git a/net-firewall/ipp2p/files/digest-ipp2p-0.8.2-r4 b/net-firewall/ipp2p/files/digest-ipp2p-0.8.2-r4
new file mode 100644
index 000000000000..14106f32db3b
--- /dev/null
+++ b/net-firewall/ipp2p/files/digest-ipp2p-0.8.2-r4
@@ -0,0 +1,3 @@
+MD5 9dd745830f302d70d0b728013c1d6a0c ipp2p-0.8.2.tar.gz 18976
+RMD160 097cd4175af3f97f3687f343087b8fe0af20ba38 ipp2p-0.8.2.tar.gz 18976
+SHA256 b265f5a1ce62de5a6cc60b9af22134a8d19b23e14b47a897057bca91188e0ee7 ipp2p-0.8.2.tar.gz 18976
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
new file mode 100644
index 000000000000..d0695e5a7d53
--- /dev/null
+++ b/net-firewall/ipp2p/files/ipp2p-0.8.2-kernel-2.6.22.patch
@@ -0,0 +1,82 @@
+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 12:52:00.000000000 +0300
++++ ipp2p-0.8.2/ipt_ipp2p.c 2007-07-11 08:00:26.000000000 +0300
+@@ -2,9 +2,18 @@
+ #include <linux/modversions.h>
+ #endif
+ #include <linux/module.h>
+-#include <linux/netfilter_ipv4/ip_tables.h>
+ #include <linux/version.h>
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
++# include <linux/netfilter/x_tables.h>
++# define ipt_register_match xt_register_match
++# define ipt_unregister_match xt_unregister_match
++# define ipt_match xt_match
++#else
++# include <linux/netfilter_ipv4/ip_tables.h>
+ //#include <linux/netfilter_ipv4/ipt_ipp2p.h>
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) */
++
+ #include "ipt_ipp2p.h"
+ #include <net/tcp.h>
+ #include <net/udp.h>
+@@ -748,7 +757,11 @@
+ {
+ 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*/
+@@ -831,7 +844,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 +858,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 +866,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
new file mode 100644
index 000000000000..faace0e0e97b
--- /dev/null
+++ b/net-firewall/ipp2p/ipp2p-0.8.2-r4.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2007 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.1 2007/07/11 05:04:26 mrness Exp $
+
+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-1.2.11"
+
+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_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-kernel-2.6.22.patch
+ convert_to_m Makefile
+
+ sed -i -e "s/^IPTABLES_VERSION/#IPTABLES_VERSION/" Makefile
+ if has_version '>=net-firewall/iptables-1.3.6' ; then
+ sed -i -e "s/ld -shared/\$\(CC\) -shared/" Makefile
+ fi
+}
+
+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() {
+ exeinto /$(get_libdir)/iptables
+ doexe libipt_ipp2p.so
+
+ dodoc README
+ linux-mod_src_install
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+}