diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c8aa869..dc3960a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,14 +60,6 @@ stages: - linux - amd64 -build-debian-8-amd64: - <<: *build-linux - image: registry.nic.cz/labs/bird:debian-8-amd64 - -build-debian-8-i386: - <<: *build-linux - image: registry.nic.cz/labs/bird:debian-8-i386 - build-debian-9-amd64: <<: *build-linux image: registry.nic.cz/labs/bird:debian-9-amd64 @@ -224,28 +216,6 @@ build-opensuse-15.3-amd64: paths: - pkg/pkgs/* -# Dpkg error: PATH is not set -#pkg-debian-8-amd64: -# <<: *pkg-deb -# needs: [build-debian-8-amd64] -# image: registry.nic.cz/labs/bird:debian-8-amd64 - -# Dpkg error: PATH is not set -#pkg-debian-8-i386: -# <<: *pkg-deb -# needs: [build-debian-8-i386] -# image: registry.nic.cz/labs/bird:debian-8-i386 - -pkg-debian-9-amd64: - <<: *pkg-deb - needs: [build-debian-9-amd64] - image: registry.nic.cz/labs/bird:debian-9-amd64 - -pkg-debian-9-i386: - <<: *pkg-deb - needs: [build-debian-9-i386] - image: registry.nic.cz/labs/bird:debian-9-i386 - pkg-debian-10-amd64: <<: *pkg-deb needs: [build-debian-10-amd64] @@ -284,7 +254,7 @@ pkg-fedora-33-amd64: pkg-fedora-34-amd64: <<: *pkg-rpm needs: [build-fedora-34-amd64] - image: registry.labs.nic.cz/labs/bird:fedora-34-amd64 + image: registry.nic.cz/labs/bird:fedora-34-amd64 pkg-centos-8-amd64: <<: *pkg-rpm-wa diff --git a/NEWS b/NEWS index c0ccaa8e..5e51a2bd 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,12 @@ Version 3.0-alpha0 (2022-02-07) o Lots of refactoring o Bugfixes and improvements as they came along +Version 2.13.1 (2023-06-23) + o BGP: Fix role check when no capability option is present + o Filter: Fixed segfault when a case option had an empty block + + This is a bugfix version. + Version 2.13 (2023-04-21) o Babel: IPv4 via IPv6 extension (RFC 9229) o Babel: Improve authentication on lossy networks diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 7ce457fe..8fed880e 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -258,12 +258,17 @@ WHITE [ \t] return IP4; } -{XIGIT}{2}((:{XIGIT}{2}){15,}|({XIGIT}{2}){15,}) { - char *s = yytext; +({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}(:?{XIGIT}{2})*)? { + char *s, *sb = yytext; size_t len = 0, i; struct bytestring *bytes; byte *b; + /* skip 'hex:' prefix */ + if (sb[0] == 'h' && sb[1] == 'e' && sb[2] == 'x' && sb[3] == ':') + sb += 4; + + s = sb; while (*s) { len++; s += 2; @@ -274,7 +279,7 @@ WHITE [ \t] bytes->length = len; b = &bytes->data[0]; - s = yytext; + s = sb; errno = 0; for (i = 0; i < len; i++) { *b = bstrtobyte16(s); diff --git a/conf/confbase.Y b/conf/confbase.Y index 8e5da9e3..4873696c 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -96,7 +96,7 @@ CF_DECLS struct timeformat *tf; struct settle_config settle; struct adata *ad; - struct bytestring *bs; + const struct bytestring *bs; } %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT diff --git a/distro/config/apkg.toml b/distro/config/apkg.toml index c70306d6..73a79a3b 100644 --- a/distro/config/apkg.toml +++ b/distro/config/apkg.toml @@ -6,3 +6,7 @@ make_archive_script = "tools/make-dev-archive" [upstream] # needed for get-archive archive_url = "https://bird.network.cz/download/bird-{{ version }}.tar.gz" + +[apkg] +# apkg compat level +compat = 3 diff --git a/distro/pkg/deb/bird.xml b/distro/pkg/deb/bird.xml index 4ba3868f..2cc69575 100644 --- a/distro/pkg/deb/bird.xml +++ b/distro/pkg/deb/bird.xml @@ -65,11 +65,23 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ &dhemail; + + Jakub + Ružička + Updated this manpage for birdcl. +
+ jakub.ruzicka@nic.cz +
+
2010 &dhusername; + + 2022 + Jakub Ružička + This manual page was written for the Debian system (and may be used by others). @@ -95,6 +107,10 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ birdc BIRD Internet Routing Daemon remote control + + birdcl + BIRD Internet Routing Daemon remote control light + @@ -118,6 +134,13 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ + + birdcl + + + + + @@ -136,7 +159,10 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ communicate. Once started, bird will give access to an interactive shell: commands can be completed with TAB and help can be requested by pressing the key `?'. More documentation on - the available commands can be foung on the website, see below. + the available commands can be found on the website, see below. + birdcl is a light version of birdc + remote control for bird without readline/ncurses support. + TAB completion isn't available. @@ -230,7 +256,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ - The birdc accepts these options: + birdc and birdcl accept these options: @@ -279,8 +305,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ SEE ALSO - More documentation con be found on the website: + More documentation can be found on the website: https://bird.network.cz/. - diff --git a/distro/pkg/deb/bird2.lintian-overrides b/distro/pkg/deb/bird2.lintian-overrides deleted file mode 100644 index e64c0ef6..00000000 --- a/distro/pkg/deb/bird2.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -bird2: binary-without-manpage usr/sbin/birdcl diff --git a/distro/pkg/deb/bird2.manpages b/distro/pkg/deb/bird2.manpages index 94898ea1..cd80062c 100644 --- a/distro/pkg/deb/bird2.manpages +++ b/distro/pkg/deb/bird2.manpages @@ -1,2 +1,3 @@ bird.8 birdc.8 +birdcl.8 diff --git a/distro/pkg/deb/changelog b/distro/pkg/deb/changelog index d371bc06..cdfe3d95 100644 --- a/distro/pkg/deb/changelog +++ b/distro/pkg/deb/changelog @@ -2,4 +2,4 @@ bird2 ({{ version }}-cznic.{{ release }}) unstable; urgency=medium * upstream package - -- Jakub Ružička Mon, 29 Mar 2021 14:15:50 +0000 + -- Jakub Ružička {{ now }} diff --git a/distro/pkg/deb/compat b/distro/pkg/deb/compat index ec635144..b4de3947 100644 --- a/distro/pkg/deb/compat +++ b/distro/pkg/deb/compat @@ -1 +1 @@ -9 +11 diff --git a/distro/pkg/deb/control b/distro/pkg/deb/control index d431022b..638795e2 100644 --- a/distro/pkg/deb/control +++ b/distro/pkg/deb/control @@ -5,18 +5,18 @@ Build-Depends: bison, debhelper, docbook-xsl, flex, - libncurses5-dev, + libncurses-dev, libreadline-dev | libreadline6-dev | libreadline5-dev, libssh-gcrypt-dev, - linuxdoc-tools-latex, m4, - opensp, quilt, - texlive-latex-extra, xsltproc +Build-Depends-Indep: linuxdoc-tools-latex, + opensp, + texlive-latex-extra Maintainer: Jakub Ružička Uploaders: Ondřej Surý -Standards-Version: 4.3.0 +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/debian/bird2 Vcs-Git: https://salsa.debian.org/debian/bird2.git Homepage: https://bird.network.cz/ @@ -26,7 +26,6 @@ Architecture: kfreebsd-any linux-any Pre-Depends: init-system-helpers, ${misc:Pre-Depends} Depends: adduser, - lsb-base, ucf, ${misc:Depends}, ${shlibs:Depends} diff --git a/distro/pkg/deb/rules b/distro/pkg/deb/rules index 5630ed1c..1740fb95 100755 --- a/distro/pkg/deb/rules +++ b/distro/pkg/deb/rules @@ -23,8 +23,7 @@ LDFLAGS += -g -O2 -fno-strict-aliasing -fno-strict-overflow -fPIC -Wl,-z,defs -W override_dh_auto_configure: CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" dh_auto_configure -- $(COMMON_FLAGS) --with-protocols=all -override_dh_auto_build: - dh_auto_build +override_dh_auto_build-indep: dh_auto_build -- docs override_dh_auto_install: @@ -47,10 +46,10 @@ override_dh_installman: bird.8 override_dh_clean: dh_clean - -rm -f bird.8 birdc.8 + -rm -f bird.8 birdc.8 birdcl.8 override_dh_missing: - dh_missing --fail-missing + dh_missing override_dh_compress: dh_compress -X.conf diff --git a/distro/pkg/deb/watch b/distro/pkg/deb/watch index 1874bfbb..cec2d664 100644 --- a/distro/pkg/deb/watch +++ b/distro/pkg/deb/watch @@ -1,2 +1,2 @@ -version=3 +version=4 https://bird.network.cz/download/bird-(2\.[\d.]+).tar.gz diff --git a/distro/pkg/rpm/bird.spec b/distro/pkg/rpm/bird.spec index cd51ef51..eb6b8aa9 100644 --- a/distro/pkg/rpm/bird.spec +++ b/distro/pkg/rpm/bird.spec @@ -1,17 +1,21 @@ %global _hardened_build 1 %global _without_doc 1 +%{!?_rundir:%global _rundir %%{_localstatedir}/run} Name: bird Version: {{ version }} Release: cznic.{{ release }}%{?dist} Summary: BIRD Internet Routing Daemon +Group: System Environment/Daemons License: GPL-2.0-or-later URL: https://bird.network.cz/ Source0: https://bird.network.cz/download/bird-%{version}.tar.gz Source1: bird.service Source2: bird.tmpfilesd +Source3: bird.sysusersd +BuildRequires: autoconf BuildRequires: flex BuildRequires: bison BuildRequires: ncurses-devel @@ -20,14 +24,13 @@ BuildRequires: sed BuildRequires: gcc BuildRequires: make BuildRequires: libssh-devel -%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} > 7) -BuildRequires: systemd-rpm-macros -%else -BuildRequires: systemd +%if 0%{?rhel} && 0%{?rhel} < 8 +# http://trubka.network.cz/pipermail/bird-users/2019-August/013631.html +BuildRequires: devtoolset-8-toolchain %endif - -Obsoletes: bird6 < 2.0.2-1 -Provides: bird6 = %{version}-%{release} +BuildRequires: systemd-rpm-macros +%{?systemd_requires} +%{?sysusers_requires_compat} %description BIRD is a dynamic IP routing daemon supporting both, IPv4 and IPv6, Border @@ -41,6 +44,7 @@ powerful language for route filtering. %if 0%{!?_without_doc:1} %package doc Summary: Documentation for BIRD Internet Routing Daemon +Group: Documentation BuildRequires: linuxdoc-tools sgml-common perl(FindBin) BuildArch: noarch @@ -57,9 +61,13 @@ powerful language for route filtering. %endif %prep -%setup -q +%setup -q -n bird-%{version} %build +%if 0%{?rhel} && 0%{?rhel} < 8 +. /opt/rh/devtoolset-8/enable +%endif + %configure --runstatedir=%{_rundir}/bird %make_build all %{!?_without_doc:docs} @@ -70,17 +78,18 @@ powerful language for route filtering. install -d %{buildroot}{%{_localstatedir}/lib/bird,%{_rundir}/bird} install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/bird.conf +install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/bird.conf {% endraw %} %check +%if 0%{?rhel} && 0%{?rhel} < 8 +. /opt/rh/devtoolset-8/enable +%endif + make test %pre -getent group bird >/dev/null || groupadd -r bird -getent passwd bird >/dev/null || \ - useradd -r -g bird -d %{_localstatedir}/lib/bird -s /sbin/nologin \ - -c "BIRD daemon user" bird -exit 0 +%sysusers_create_compat %{SOURCE3} %post %systemd_post bird.service @@ -95,12 +104,13 @@ exit 0 %doc NEWS README %attr(0640,root,bird) %config(noreplace) %{_sysconfdir}/bird.conf %{_unitdir}/bird.service +%{_sysusersdir}/bird.conf %{_tmpfilesdir}/bird.conf %{_sbindir}/bird %{_sbindir}/birdc %{_sbindir}/birdcl %dir %attr(0750,bird,bird) %{_localstatedir}/lib/bird -%dir %attr(0750,bird,bird) %ghost %{_rundir}/bird +%dir %attr(0750,bird,bird) %{_rundir}/bird %if 0%{!?_without_doc:1} %files doc diff --git a/distro/pkg/rpm/bird.sysusersd b/distro/pkg/rpm/bird.sysusersd new file mode 100644 index 00000000..1c808666 --- /dev/null +++ b/distro/pkg/rpm/bird.sysusersd @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u bird - "BIRD daemon user" /var/lib/bird - diff --git a/distro/tests/control b/distro/tests/control new file mode 100644 index 00000000..f588af8f --- /dev/null +++ b/distro/tests/control @@ -0,0 +1,3 @@ +Tests: test-bird.sh +Restrictions: needs-root +Depends: bird2, iproute2 diff --git a/distro/tests/test-bird.sh b/distro/tests/test-bird.sh new file mode 100755 index 00000000..464be32f --- /dev/null +++ b/distro/tests/test-bird.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +set -e + +LOCAL=2001:db8:dead:: + +EXTERNAL=2001:db8:beef:: +EXTERNAL_NET=${EXTERNAL}/48 +EXTERNAL_NH=${LOCAL}beef + +LEARN=2001:db8:feed:: +LEARN_NET=${LEARN}/48 +LEARN_NH=${LOCAL}feed + +IFACE=bird-test-dummy +IFACE_EXISTS=false + +BIRD_RUNNING=false + +D=$(mktemp -d) +pushd ${D} >/dev/null + +stop_bird() { + birdc -l down >/dev/null + sleep 1 + grep -q " Shutdown completed" bird.log + [ ! -e bird.pid ] + [ ! -e bird.ctl ] +} + +cleanup() { + if ${BIRD_RUNNING}; then + stop_bird + if [ -e bird.pid ]; then + kill -9 $( /dev/null + rm -rf ${D} +} + +failed() { + cleanup + exit 1 +} + +trap failed ERR +trap failed INT +trap failed HUP + +ip link add ${IFACE} type dummy +IFACE_EXISTS=true + +ip link set ${IFACE} up +ip -6 addr add ${LOCAL}/64 dev bird-test-dummy + +ip -6 route add ${LEARN_NET} via ${LEARN_NH} + +cat >bird.conf <] { ipv6 [sadr] { }; randomize router id ; interface { - type ; + type ; rxcost ; limit ; hello interval