summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-06-04 13:16:00 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-06-04 13:17:53 +0300
commitce9ac75d9d14b4a366b05267fee02e27d66066a2 (patch)
treeb81fa954612096dece0d4c00c1b7da7f466cdde2 /testing
parentc43bfc5064d44127cbf17c4767fae2f06a3ac663 (diff)
downloadaports-ce9ac75d9d14b4a366b05267fee02e27d66066a2.tar.bz2
aports-ce9ac75d9d14b4a366b05267fee02e27d66066a2.tar.xz
testing/quagga-nhrp: new aport
Quagga with nhrpd patches applied http://git.alpinelinux.org/cgit/tteras/quagga/?h=nhrp
Diffstat (limited to 'testing')
-rw-r--r--testing/quagga-nhrp/APKBUILD91
-rw-r--r--testing/quagga-nhrp/bgpd-gr-route-selection-fix.patch37
-rw-r--r--testing/quagga-nhrp/bgpd.initd22
-rw-r--r--testing/quagga-nhrp/quagga-nhrp.post-install9
l---------testing/quagga-nhrp/quagga-nhrp.post-upgrade1
-rw-r--r--testing/quagga-nhrp/quagga-nhrp.pre-install6
-rw-r--r--testing/quagga-nhrp/zebra.confd7
-rw-r--r--testing/quagga-nhrp/zebra.initd34
8 files changed, 207 insertions, 0 deletions
diff --git a/testing/quagga-nhrp/APKBUILD b/testing/quagga-nhrp/APKBUILD
new file mode 100644
index 000000000..185432b6e
--- /dev/null
+++ b/testing/quagga-nhrp/APKBUILD
@@ -0,0 +1,91 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=quagga-nhrp
+pkgver=0.99.24.1_git20150604
+_commitid=50d13daccf98a805c35c4e3f58c445948362204b
+pkgrel=0
+pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF, BGP and NHRP."
+url="http://git.alpinelinux.org/cgit/tteras/quagga/commit/?h=nhrp"
+arch="all"
+license="GPL-2"
+depends="iproute2"
+makedepends="gawk texinfo perl autoconf automake
+ linux-headers readline-dev ncurses-dev net-snmp-dev libcap-dev"
+provides="quagga=0.99"
+install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
+pkgusers="quagga"
+pkggroups="quagga"
+source="quagga-nhrp-$pkgver.tar.bz2::http://git.alpinelinux.org/cgit/tteras/quagga/snapshot/quagga-$_commitid.tar.bz2
+ bgpd-gr-route-selection-fix.patch
+ bgpd.initd
+ zebra.initd
+ zebra.confd
+ "
+
+_builddir="$srcdir"/quagga-$_commitid
+prepare() {
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ ./bootstrap.sh || return 1
+}
+
+build() {
+ cd "$_builddir"
+ quagga_cv_ipforward_method=proc \
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --disable-static \
+ --enable-ospf6d \
+ --enable-rtadv \
+ --enable-user=quagga \
+ --enable-group=quagga \
+ --enable-vty-group=quagga \
+ --enable-vtysh \
+ --enable-snmp \
+ --enable-multipath=64 \
+ --enable-pimd \
+ --sysconfdir=/etc/quagga \
+ --enable-exampledir=/usr/share/doc/quagga/ \
+ --localstatedir=/var/run/quagga \
+ || return 1
+
+ # add CFLAGS to work around textrel issue
+ make CFLAGS+="-fPIC" || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ rm "$pkgdir"/usr/lib/*.la || return 1
+
+ install -o quagga -g quagga -d "$pkgdir"/var/run/quagga
+ for i in zebra bgpd; do
+ install -Dm755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/$i
+ done
+ for i in ripd ospfd ripngd ospf6d nhrpd; do
+ ln -s bgpd "$pkgdir"/etc/init.d/$i || return 1
+ done
+ install -Dm644 "$srcdir/zebra.confd" "$pkgdir"/etc/conf.d/zebra
+ install -o quagga -g quagga -d -m755 "$pkgdir"/etc/quagga
+}
+md5sums="664b6f2bb535c01c8c720967173a6248 quagga-nhrp-0.99.24.1_git20150604.tar.bz2
+1fbfcff69bc7df56f9e6682012261004 bgpd-gr-route-selection-fix.patch
+09a77e2e84e71c43f5a449738c026261 bgpd.initd
+916f1dd1a286ee7b862cda4fe56cbf21 zebra.initd
+34e06a1d2bc602ce691abc9ed169dd15 zebra.confd"
+sha256sums="70659a04d0dd6102dc7903d0f89eb32c9d01eb82e863b75daea733cb77923a67 quagga-nhrp-0.99.24.1_git20150604.tar.bz2
+66de5b7c097aeb1767001547e219af51e43f968bd241dec7f0c71b68b54855de bgpd-gr-route-selection-fix.patch
+aab037454c6a70cd5cb45e14c47b7dfea358f8d81c7d12418edcf7e58a86c679 bgpd.initd
+c1d7526581927e990e687cbd5d08447eb060f76a439475572785b5b90c60c460 zebra.initd
+f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd"
+sha512sums="0eae46ec43c06060aad0870da4c8595160c814c822dde14dd4e84b32bc01722848460c3035e11404d7e071ce64dccafa0951ebc9ef044bb788b5adb988808c9a quagga-nhrp-0.99.24.1_git20150604.tar.bz2
+3e3e1862739ed47da38720d87669ee0bfa2d6e2c2c65388727c92a22cad8b5bf9f4c302701cbd0cf3ac0186eeb1498aefed74c85d8f43ced41c78680fdbbc2ac bgpd-gr-route-selection-fix.patch
+13b5b57e10df013bd2d931abc49bf76b8c4dee59dbceab22c9f151ccb988b2c5f7167f2909027d5e0f990b59da8de115667b02484aee9a67d347625700f6cacd bgpd.initd
+1638a4a64ffd066b1884f7e5a4243edab68739aabd83bd35ea8c9608af7b8623eece1d59fb08feead84e4386b6d1da4220764ccf5fd7f2a9959a8470d5cce86a zebra.initd
+900972c6f98e561dfacf384111251db262326e8764b8c763a5ef639fa11c7949c03eef5e3bce324a4b1964fe45416d2db74ae1b6bc967f7d4ba48c2eeda017c4 zebra.confd"
diff --git a/testing/quagga-nhrp/bgpd-gr-route-selection-fix.patch b/testing/quagga-nhrp/bgpd-gr-route-selection-fix.patch
new file mode 100644
index 000000000..36719d375
--- /dev/null
+++ b/testing/quagga-nhrp/bgpd-gr-route-selection-fix.patch
@@ -0,0 +1,37 @@
+During best path selection, if one of the candidates is a stale entry, do not
+perform the neighbor address comparison as that information is invalid for
+the stale entry. Attempting to perform the comparison results in a bgpd
+exception.
+
+diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
+index cca26d8..d30c643 100644
+--- a/bgpd/bgp_route.c
++++ b/bgpd/bgp_route.c
+@@ -540,7 +540,11 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist,
+ return 0;
+ }
+
+- /* 11. Rourter-ID comparision. */
++ /* 11. Router-ID comparision. */
++ /* If one of the paths is "stale", the corresponding peer router-id will
++ * be 0 and would always win over the other path. If originator id is
++ * used for the comparision, it will decide which path is better.
++ */
+ if (newattr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
+ new_id.s_addr = newattre->originator_id.s_addr;
+ else
+@@ -565,6 +569,14 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist,
+ return 0;
+
+ /* 13. Neighbor address comparision. */
++ /* Do this only if neither path is "stale" as stale paths do not have
++ * valid peer information (as the connection may or may not be up).
++ */
++ if (CHECK_FLAG (exist->flags, BGP_INFO_STALE))
++ return 1;
++ if (CHECK_FLAG (new->flags, BGP_INFO_STALE))
++ return 0;
++
+ ret = sockunion_cmp (new->peer->su_remote, exist->peer->su_remote);
+
+ if (ret == 1)
diff --git a/testing/quagga-nhrp/bgpd.initd b/testing/quagga-nhrp/bgpd.initd
new file mode 100644
index 000000000..bd1e4c6c9
--- /dev/null
+++ b/testing/quagga-nhrp/bgpd.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+
+piddir=/var/run/quagga
+pidfile=$piddir/$SVCNAME.pid
+command=/usr/sbin/$SVCNAME
+command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"
+
+depend() {
+ need net zebra
+ after firewall opennhrp
+}
+
+start_pre() {
+ if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then
+ eerror "You need to create /etc/quagga/$SVCNAME.conf first."
+ eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample"
+ eerror "from quagga-doc package"
+ return 1
+ fi
+ checkpath --owner quagga:quagga --directory $piddir
+}
+
diff --git a/testing/quagga-nhrp/quagga-nhrp.post-install b/testing/quagga-nhrp/quagga-nhrp.post-install
new file mode 100644
index 000000000..b4bcef1e7
--- /dev/null
+++ b/testing/quagga-nhrp/quagga-nhrp.post-install
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# early quaggas had an entry in ld.so.conf. We dont need it anymore
+if [ -r /etc/ld.so.conf ]; then
+ sed -i -e '/usr\/lib\/quagga/d' /etc/ld.so.conf
+ # remove if zero sized
+ [ -s /etc/ld.so.conf ] || rm /etc/ld.so.conf
+fi
+exit 0
diff --git a/testing/quagga-nhrp/quagga-nhrp.post-upgrade b/testing/quagga-nhrp/quagga-nhrp.post-upgrade
new file mode 120000
index 000000000..1dcbc73fb
--- /dev/null
+++ b/testing/quagga-nhrp/quagga-nhrp.post-upgrade
@@ -0,0 +1 @@
+quagga-nhrp.post-install \ No newline at end of file
diff --git a/testing/quagga-nhrp/quagga-nhrp.pre-install b/testing/quagga-nhrp/quagga-nhrp.pre-install
new file mode 100644
index 000000000..c0fe3c8c5
--- /dev/null
+++ b/testing/quagga-nhrp/quagga-nhrp.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S quagga 2>/dev/null
+adduser -S -h /var/run/quagga -s /sbin/nologin -D -G quagga quagga 2>/dev/null
+exit 0
+
diff --git a/testing/quagga-nhrp/zebra.confd b/testing/quagga-nhrp/zebra.confd
new file mode 100644
index 000000000..d2deb114e
--- /dev/null
+++ b/testing/quagga-nhrp/zebra.confd
@@ -0,0 +1,7 @@
+# Additional command-line parameters to run zebra with:
+# -k, --keep_kernel Don't delete old routes which installed by zebra.
+# -A, --vty_addr addr Set vty's bind address
+# -P, --vty_port port Set vty's port number
+# -r, --retain When program terminates, retain added route by zebra.
+# -s, --nl-bufsize Set netlink receive buffer size
+ZEBRA_OPTS=""
diff --git a/testing/quagga-nhrp/zebra.initd b/testing/quagga-nhrp/zebra.initd
new file mode 100644
index 000000000..6ab297e74
--- /dev/null
+++ b/testing/quagga-nhrp/zebra.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+
+piddir=/var/run/quagga
+pidfile=$piddir/$SVCNAME.pid
+command=/usr/sbin/$SVCNAME
+command_args="-d -f /etc/quagga/$SVCNAME.conf --pid_file $pidfile"
+
+depend() {
+ need net
+ after firewall opennhrp
+}
+
+cleanup() {
+ ebegin "Cleaning up stale zebra routes..."
+ ip route flush proto zebra
+ eend $?
+}
+
+checkconfig() {
+ if ! [ -e /etc/quagga/$SVCNAME.conf ] ; then
+ eerror "You need to create /etc/quagga/$SVCNAME.conf first."
+ eerror "An example can be found in /usr/share/doc/quagga/$SVCNAME.conf.sample"
+ eerror "from quagga-doc package"
+ return 1
+ fi
+ return 0
+}
+
+start_pre() {
+ checkconfig || return 1
+ checkpath --owner quagga:quagga --directory $piddir
+ cleanup
+}
+