summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoredward-p2018-08-18 13:04:26 +0800
committeredward-p2018-08-18 13:04:26 +0800
commit487f43dea7ed77fd4f48bb3b80821934bbe20731 (patch)
treea1e155754304f7759701d3cb77900164e297dedd
downloadaur-487f43dea7ed77fd4f48bb3b80821934bbe20731.tar.gz
init commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD37
-rw-r--r--dkms.conf8
-rw-r--r--xt_FULLCONENAT.c.patch11
4 files changed, 75 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..b6b8993d3ba
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = netfilter-full-cone-nat-dkms
+ pkgdesc = A kernel module that turns MASQUERADE into full cone SNAT
+ pkgver = ec14efe
+ pkgrel = 1
+ url = https://github.com/Chion82/netfilter-full-cone-nat
+ arch = x86_64
+ license = GPL2
+ depends = dkms
+ depends = linux-headers
+ conflicts = netfilter-full-cone-nat
+ source = dkms.conf
+ source = xt_FULLCONENAT.c.patch
+ source = git+https://github.com/Chion82/netfilter-full-cone-nat
+ md5sums = 777351816b13fdf7da0e573fb160eab2
+ md5sums = ceda7d1fc776845741cc0acf12f3fb2e
+ md5sums = SKIP
+
+pkgname = netfilter-full-cone-nat-dkms
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c13167d257b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Edward Pacman <micro(dot)fedora(at)gmail(dot)com>
+
+_pkgbase=netfilter-full-cone-nat
+pkgname=netfilter-full-cone-nat-dkms
+pkgver=ec14efe
+pkgrel=1
+pkgdesc="A kernel module that turns MASQUERADE into full cone SNAT"
+arch=('x86_64')
+url="https://github.com/Chion82/netfilter-full-cone-nat"
+license=('GPL2')
+depends=('dkms' 'linux-headers')
+conflicts=("${_pkgbase}")
+source=('dkms.conf'
+ 'xt_FULLCONENAT.c.patch'
+ 'git+https://github.com/Chion82/netfilter-full-cone-nat')
+md5sums=('777351816b13fdf7da0e573fb160eab2'
+ 'ceda7d1fc776845741cc0acf12f3fb2e'
+ 'SKIP')
+
+build() {
+ cd ${srcdir}/${_pkgbase}
+ patch -p1 -i "${srcdir}"/xt_FULLCONENAT.c.patch
+}
+
+package() {
+ # Copy dkms.conf
+ install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
+
+ # Set name and version
+ sed -e "s/@_PKGBASE@/${_pkgbase}/" \
+ -e "s/@PKGVER@/${pkgver}/" \
+ -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
+
+ # Copy sources (including Makefile)
+ cp -r ${_pkgbase}/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
+}
+
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 00000000000..4006a3535be
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,8 @@
+PACKAGE_NAME="@_PKGBASE@"
+PACKAGE_VERSION="@PKGVER@"
+MAKE[0]="make"
+CLEAN="make clean"
+BUILT_MODULE_NAME[0]="xt_FULLCONENAT"
+DEST_MODULE_LOCATION[0]="/kernel/net/netfilter"
+AUTOINSTALL="yes"
+
diff --git a/xt_FULLCONENAT.c.patch b/xt_FULLCONENAT.c.patch
new file mode 100644
index 00000000000..1359b46c41e
--- /dev/null
+++ b/xt_FULLCONENAT.c.patch
@@ -0,0 +1,11 @@
+--- a/xt_FULLCONENAT.c
++++ b/xt_FULLCONENAT.c
+@@ -472,7 +472,7 @@ static unsigned int fullconenat_tg(struct sk_buff *skb, const struct xt_action_p
+
+ struct nat_mapping *mapping, *src_mapping;
+ unsigned int ret;
+- struct nf_nat_range newrange;
++ struct nf_nat_range2 newrange;
+
+ __be32 new_ip, ip;
+ uint16_t port, original_port, want_port;