diff --git a/bird/17de3a023f7bde293892b41bfafe5740c8553fc8.patch b/bird/17de3a023f7bde293892b41bfafe5740c8553fc8.patch new file mode 100644 index 0000000..931b03b --- /dev/null +++ b/bird/17de3a023f7bde293892b41bfafe5740c8553fc8.patch @@ -0,0 +1,32 @@ +From 17de3a023f7bde293892b41bfafe5740c8553fc8 Mon Sep 17 00:00:00 2001 +From: "Ondrej Zajicek (work)" +Date: Wed, 29 Apr 2020 02:50:29 +0200 +Subject: [PATCH] BGP: Fix handling of strange IPv6 link-local-only next hops + +There are three common ways how to encode IPv6 link-local-only next hops: +(:: ll), (ll), and (ll ll). We use the first one but we should accept all +three. The patch fixes handling of the last one. + +Thanks to Sebastian Hahn for the bugreport. +--- + proto/bgp/packets.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c +index ee031c05..78fdd1e0 100644 +--- a/proto/bgp/packets.c ++++ b/proto/bgp/packets.c +@@ -1157,7 +1157,10 @@ bgp_decode_next_hop_ip(struct bgp_parse_state *s, byte *data, uint len, rta *a) + nh[0] = ipa_from_ip6(get_ip6(data)); + nh[1] = ipa_from_ip6(get_ip6(data+16)); + +- if (ipa_is_ip4(nh[0]) || !ip6_is_link_local(nh[1])) ++ if (ipa_is_link_local(nh[0])) ++ { nh[1] = nh[0]; nh[0] = IPA_NONE; } ++ ++ if (ipa_is_ip4(nh[0]) || !ipa_is_link_local(nh[1])) + nh[1] = IPA_NONE; + } + else +-- +2.24.1 diff --git a/bird/PKGBUILD b/bird/PKGBUILD new file mode 100644 index 0000000..82a7eaa --- /dev/null +++ b/bird/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Sébastien Luttringer + +pkgname=bird +pkgver=2.0.7 +pkgrel=3 +pkgdesc='RIP, OSPF, BGP, MPLS, BFD, Babbel routing daemon' +arch=('x86_64') +url='https://bird.network.cz/' +license=('GPL2') +backup=('etc/bird.conf') +depends=('glibc' 'readline' 'ncurses' 'libssh') +replaces=('bird6') +source=("ftp://bird.network.cz/pub/bird/$pkgname-$pkgver.tar.gz" + 'bird.service' + '17de3a023f7bde293892b41bfafe5740c8553fc8.patch') +md5sums=('dc884bbe5905578e452f28158700527c' + '69221e063a3f07dcad519d5eeacaae75' + '1afeb88ca6f4c9634da95937156f59a5') + +prepare() { + cd $pkgname-$pkgver + # apply patch from the source array (should be a pacman feature) + local filename + for filename in "${source[@]}"; do + if [[ "$filename" =~ \.patch$ ]]; then + msg2 "Applying patch ${filename##*/}" + patch -p1 -N -i "$srcdir/${filename##*/}" + fi + done + : +} + +build() { + cd $pkgbase-$pkgver + CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common + ./configure \ + --prefix=/usr \ + --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --docdir=/usr/share/doc/$pkgname + make +} + +package () { + + cd $pkgbase-$pkgver + make \ + prefix="$pkgdir/usr" \ + sysconfdir="$pkgdir/etc" \ + sbindir="$pkgdir/usr/bin" \ + localstatedir="$pkgdir/var" \ + docdir="$pkgdir/usr/share/doc/$pkgname" \ + install + + # no /var inside pkg + rm -r "$pkgdir/var" + + # systemd + install -D -m 644 "$srcdir/bird.service" "$pkgdir/usr/lib/systemd/system/bird.service" + + # overwrite invalid default config file (see FS#57096) + install -D -m 644 doc/bird.conf.example2 "$pkgdir/etc/bird.conf" +} + +# vim:set ts=2 sw=2 et: diff --git a/bird/autobuild.yaml b/bird/autobuild.yaml new file mode 100644 index 0000000..f9e1b29 --- /dev/null +++ b/bird/autobuild.yaml @@ -0,0 +1,4 @@ +type: + auto +priority: + 10 diff --git a/bird/bird.service b/bird/bird.service new file mode 100644 index 0000000..c2e2572 --- /dev/null +++ b/bird/bird.service @@ -0,0 +1,12 @@ +[Unit] +Description=BIRD routing daemon +After=network.target + +[Service] +Type=forking +ExecStart=/usr/bin/bird +ExecReload=/usr/bin/birdc configure +ExecStop=/usr/bin/birdc down + +[Install] +WantedBy=multi-user.target