diff options
author | Timo Sarawinski | 2020-02-07 17:16:53 +0100 |
---|---|---|
committer | Timo Sarawinski | 2020-02-07 17:16:53 +0100 |
commit | 726c32ac123783425b4a66f702713cd97a27a902 (patch) | |
tree | bec6a5acd284980c6ae3a0b0de3a8f802bdad24b | |
download | aur-726c32ac123783425b4a66f702713cd97a27a902.tar.gz |
first release
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | fix-checksum-calculation.patch | 41 | ||||
-rw-r--r-- | mcproxy.conf | 28 | ||||
-rw-r--r-- | mcproxy.service | 10 |
5 files changed, 146 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b2ef7b25ebc9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = mcproxy + pkgdesc = Multicast Proxy for IGMP/MLD + pkgver = 1.1.1 + pkgrel = 1 + url = http://mcproxy.realmv6.org + arch = any + license = GPL + makedepends = doxygen + depends = qt5-base + provides = mcproxy + source = https://github.com/mcproxy/mcproxy/archive/v1.1.1.tar.gz + source = mcproxy.conf + source = mcproxy.service + source = fix-checksum-calculation.patch + sha256sums = 07f09ce2726e2300b5df6a053a5cc62613932183bbab7b503feec60cea65897a + sha256sums = 7c0c8b43104a3136a2628196e6914a1aefa413a6b0e43c5eb88f986206f2eb10 + sha256sums = 9dece4bdb0afe05d18ad5b696b1c9553ecf0418d36d0d13a2c9ea491fca6026d + sha256sums = c5006fe4f708ac10337e145b72417d3b51218324ba24346cb8959d01af4a5de3 + +pkgname = mcproxy + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..918997a038a8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Timo Sarawinski <timo@it-kraut.net> + +pkgname=mcproxy +pkgver=1.1.1 +pkgrel=1 +pkgdesc="Multicast Proxy for IGMP/MLD" +arch=('any') +url=http://mcproxy.realmv6.org +license=('GPL') +depends=('qt5-base') +makedepends=('doxygen') +provides=('mcproxy') +source=('https://github.com/mcproxy/mcproxy/archive/v1.1.1.tar.gz' + 'mcproxy.conf' + 'mcproxy.service' + 'fix-checksum-calculation.patch') +sha256sums=('07f09ce2726e2300b5df6a053a5cc62613932183bbab7b503feec60cea65897a' + '7c0c8b43104a3136a2628196e6914a1aefa413a6b0e43c5eb88f986206f2eb10' + '9dece4bdb0afe05d18ad5b696b1c9553ecf0418d36d0d13a2c9ea491fca6026d' + 'c5006fe4f708ac10337e145b72417d3b51218324ba24346cb8959d01af4a5de3') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}" + sed -i 's/target.path = \/usr\/local\/bin/target.path = \/usr\/bin/g' mcproxy.pro + patch -p1 -i ../../fix-checksum-calculation.patch +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}" + qmake + make doc + make +} + +check() { + cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}" + make check +} +package() { + cd "${srcdir}/${pkgname}-${pkgver}/${pkgname}" + local _pkg_dir=${pkgdir}/usr/ + INSTALL_ROOT=${_pkg_dir} make install + install -Dm644 ${srcdir}/mcproxy.conf ${pkgdir}/etc/mcproxy/mcproxy.conf + install -Dm644 ${srcdir}/mcproxy.service "${pkgdir}/usr/lib/systemd/system/mcproxy.service" +} + diff --git a/fix-checksum-calculation.patch b/fix-checksum-calculation.patch new file mode 100644 index 000000000000..66d39bf8bc05 --- /dev/null +++ b/fix-checksum-calculation.patch @@ -0,0 +1,41 @@ +From 93b5ace42268160ebbfff4c61818fb15fa2d9b99 Mon Sep 17 00:00:00 2001 +From: Sebastian Woelke <Sebastian.Woelke@posteo.de> +Date: Thu, 24 Aug 2017 14:41:50 +0200 +Subject: [PATCH] Fix checksum calculation + +--- + mcproxy/src/utils/mroute_socket.cpp | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/src/utils/mroute_socket.cpp b/src/utils/mroute_socket.cpp +index 61289ddb..3a553591 100644 +--- a/src/utils/mroute_socket.cpp ++++ b/src/utils/mroute_socket.cpp +@@ -157,17 +157,23 @@ u_int16_t mroute_socket::calc_checksum(const unsigned char* buf, int buf_size) c + + u_int16_t* b = (u_int16_t*)buf; + int sum = 0; ++ int csum; + + for (int i = 0; i < buf_size / 2; i++) { +- ADD_SIGNED_NUM_U16(sum, b[i]); +- //sum +=b[i]; ++ sum +=b[i]; + } + + if (buf_size % 2 == 1) { +- //sum += buf[buf_size-1]; +- ADD_SIGNED_NUM_U16(sum, buf[buf_size - 1]); ++ sum += buf[buf_size-1]; + } + ++ // fold checksum ++ csum = sum & 0xFFFF; ++ sum = sum >> 16; ++ sum += csum; ++ // fold again in case of overflow. ++ sum += sum >> 16; ++ + return ~sum; + } + diff --git a/mcproxy.conf b/mcproxy.conf new file mode 100644 index 000000000000..0c99a7f31794 --- /dev/null +++ b/mcproxy.conf @@ -0,0 +1,28 @@ +###################################### +##-- mcproxy configuration script --## +###################################### + +#protocol MLDv2; #IPv6 +protocol IGMPv3; #IPv4 + +pinstance myProxy: eth0 ==> eth1 eth2; +#pinstance my_second_instance: tun1 ==> "vlan-eth0.2"; + +# +# This confiugration example creates +# a multicast proxy for ipv4 with the +# upstream eth0 and two downstreams. +# +# | +# | +# +------+-----+ +# | eth0 | +# | | +# | myProxy | +# | | +# | eth1 eth2 | +# +---+----+---+ +# | | +# | | +# + diff --git a/mcproxy.service b/mcproxy.service new file mode 100644 index 000000000000..b79e9f68655e --- /dev/null +++ b/mcproxy.service @@ -0,0 +1,10 @@ +[Unit] +Description=mcproxy multicast proxy for IGMP/MLD (RFC 4605) +Documentation=http://mcproxy.realmv6.org/wiki/Documentation +After=network.target netctl@wlan0\x2dFuuulan\x205.service pihole-FTL.service iptables.service + +[Service] +ExecStart=/usr/bin/mcproxy -r -f /etc/mcproxy/mcproxy.conf + +[Install] +WantedBy=multi-user.target |