SHA256
1
0
forked from pool/bird

Accepting request 833673 from home:dirkmueller:branches:network

- update to 2.0.2:
  o Integrated IPv4 + IPv6 design
  * many changes, see included NEWS for details
  * obsoletes separate bird6/bird-common subpackages
- remove bird-1.6.3_verbose.build.patch bufferoverflow.patch: obsolete
- add gcc10.patch (fix build with gcc 10), disable -fcommon again
- reenable fortify-source

OBS-URL: https://build.opensuse.org/request/show/833673
OBS-URL: https://build.opensuse.org/package/show/network/bird?expand=0&rev=12
This commit is contained in:
Martin Hauke 2020-09-25 22:54:13 +00:00 committed by Git OBS Bridge
parent 9530594849
commit 7792ee7ff9
8 changed files with 51 additions and 156 deletions

View File

@ -1,23 +0,0 @@
Index: bird-1.6.3/tools/Rules.in
===================================================================
--- bird-1.6.3.orig/tools/Rules.in
+++ bird-1.6.3/tools/Rules.in
@@ -68,14 +68,14 @@ subdir: all.o
all.o: $(objs)
# $(LD) -r -o $@ $^
# Changed to $(CC) because $(LD) has problems with crosscompiling
- @echo LD -r -o $@ $^
- @$(CC) -nostdlib -r -o $@ $^
+# @echo LD -r -o $@ $^
+ $(CC) -nostdlib -r -o $@ $^
endif
%.o: $(src-path)%.c
- @echo CC -o $@ -c $<
- @$(CC) $(CFLAGS) -o $@ -c $<
+# @echo CC -o $@ -c $<
+ $(CC) $(CFLAGS) -o $@ -c $<
ifndef source-dep
source-dep := $(source)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c61ab5d2ef59d2559a8735b8252b5a0238013b43e5fb8a96c5d9d06e7bc00b2
size 1042222

3
bird-2.0.7.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:631d2b58aebdbd651aaa3c68c3756c02ebfe5b1e60d307771ea909eeaa5b1066
size 1993395

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Fri Sep 11 07:16:11 UTC 2020 - Dirk Mueller <dmueller@suse.com>
- update to 2.0.2:
o Integrated IPv4 + IPv6 design
* many changes, see included NEWS for details
* obsoletes separate bird6/bird-common subpackages
- remove bird-1.6.3_verbose.build.patch bufferoverflow.patch: obsolete
- add gcc10.patch (fix build with gcc 10), disable -fcommon again
- reenable fortify-source
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 17 11:26:13 UTC 2020 - Paolo Stivanin <info@paolostivanin.com> Wed Jun 17 11:26:13 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>

102
bird.spec
View File

@ -21,7 +21,7 @@
%define bird_home %{_localstatedir}/lib/bird %define bird_home %{_localstatedir}/lib/bird
%define bird_runtimedir %{_rundir}/%{name} %define bird_runtimedir %{_rundir}/%{name}
Name: bird Name: bird
Version: 1.6.8 Version: 2.0.7
Release: 0 Release: 0
Summary: The BIRD Internet Routing Daemon Summary: The BIRD Internet Routing Daemon
License: GPL-2.0-or-later License: GPL-2.0-or-later
@ -29,17 +29,19 @@ Group: Productivity/Networking/Routing
URL: https://bird.network.cz/ URL: https://bird.network.cz/
Source: ftp://bird.network.cz/pub/bird/bird-%{version}.tar.gz Source: ftp://bird.network.cz/pub/bird/bird-%{version}.tar.gz
Source1: bird.service Source1: bird.service
Source2: bird6.service
Source3: bird.tmpfiles.d Source3: bird.tmpfiles.d
Patch0: bird-1.6.3_verbose.build.patch Patch0: gcc10.patch
Patch1: bufferoverflow.patch
BuildRequires: bison BuildRequires: bison
BuildRequires: flex BuildRequires: flex
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
Requires: bird-common Provides: bird6 = %{version}
Provides: bird6:%{_sbindir}/bird6
Obsoletes: bird6 < %{version}
Provides: bird-common = %{version}
Obsoletes: bird-common < %{version}
%description %description
BIRD is an implementation for routing Internet Protocol packets. IPv4 BIRD is an implementation for routing Internet Protocol packets. IPv4
@ -47,35 +49,14 @@ and IPv6 are supported by running separate daemons. It establishes
multiple routing tables, and uses BGP, RIP, and OSPF routing multiple routing tables, and uses BGP, RIP, and OSPF routing
protocols, as well as statically defined routes. protocols, as well as statically defined routes.
This package holds the IPv4 binaries. This package holds the IPv4+IPv6 binaries.
%package -n bird6
Summary: The BIRD Internet Routing Daemon for IPv6
Group: Productivity/Networking/Routing
Requires: bird-common
%description -n bird6
BIRD is an implementation for routing Internet Protocol packets. IPv4
and IPv6 are supported by running separate daemons. It establishes
multiple routing tables, and uses BGP, RIP, and OSPF routing
protocols, as well as statically defined routes.
This package holds the IPv6 binaries.
%package common
Summary: Common files for the BIRD Internet Routing Daemon
Group: Productivity/Networking/Routing
Requires(pre): shadow
%{?systemd_requires}
%description common
BIRD is an implementation for routing Internet Protocol packets.
This package holds common files and directories. This package holds common files and directories.
%package doc %package doc
Summary: Documentation for the BIRD Internet Routing Daemon Summary: Documentation for the BIRD Internet Routing Daemon
Group: Documentation/HTML Group: Documentation/HTML
BuildRequires: perl-FindBin-Real
%description doc %description doc
BIRD is an implementation for routing Internet Protocol packets. BIRD is an implementation for routing Internet Protocol packets.
@ -85,73 +66,44 @@ This package holds the HTML documentation.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch0 -p1
%patch1 -p1
%build %build
# gcc detects overflow in strncpy at proto/rip/packets.c:215:5 export CFLAGS="${RPM_OPT_FLAGS} -fpic -DPIC -fno-strict-aliasing -Wno-parentheses -Wno-pointer-sign"
# but it's false alarm, relax gcc (-D_FORTIFY_SOURCE=1)
# see http://bird.network.cz/pipermail/bird-users/2016-May/010380.html
export CFLAGS="${RPM_OPT_FLAGS//-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=0} -fpic -DPIC -fno-strict-aliasing -Wno-parentheses -Wno-pointer-sign -fcommon"
export LDFLAGS="-Wl,-z,relro -pie" export LDFLAGS="-Wl,-z,relro -pie"
%define _configure ../configure
mkdir 4 6
pushd 4
%configure \ %configure \
--with-runtimedir=%{bird_runtimedir} --with-runtimedir=%{bird_runtimedir}
make %{?_smp_mflags} %make_build all
popd # requires linuxdoctools
pushd 6 # make docs
%configure --enable-ipv6 \
--with-runtimedir=%{bird_runtimedir}
make %{?_smp_mflags}
popd
%install %install
%make_install -C 4 %make_install
%make_install -C 6
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/bird6.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -D -m 0644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcbird ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcbird
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcbird6
install -D -d -m 0750 %{buildroot}%{bird_home} install -D -d -m 0750 %{buildroot}%{bird_home}
install -D -d -m 0750 %{buildroot}%{_docdir}/%{name}/ install -D -d -m 0750 %{buildroot}%{_docdir}/%{name}/
cp -av NEWS README doc/bird*.html %{buildroot}%{_docdir}/%{name}/
%pre common %check
make test
%pre
# Create bird user/group # Create bird user/group
getent group %{bird_group} >/dev/null || groupadd -r %{bird_group} getent group %{bird_group} >/dev/null || groupadd -r %{bird_group}
getent passwd %{bird_user} >/dev/null || useradd -r -g %{bird_group} -d %{bird_home} -s /sbin/nologin -c "Bird routing daemon" %{bird_user} getent passwd %{bird_user} >/dev/null || useradd -r -g %{bird_group} -d %{bird_home} -s /sbin/nologin -c "Bird routing daemon" %{bird_user}
exit 0
%post common
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf || true
%pre
%service_add_pre bird.service %service_add_pre bird.service
%pre -n bird6
%service_add_pre bird6.service
%preun %preun
%service_del_preun bird.service %service_del_preun bird.service
%preun -n bird6
%service_del_preun bird6.service
%post %post
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf || true
%service_add_post bird.service %service_add_post bird.service
%post -n bird6
%service_add_post bird6.service
%postun %postun
%service_del_postun bird.service %service_del_postun bird.service
%postun -n bird6
%service_del_postun bird6.service
%files %files
%config(noreplace) %attr(0640,root,%{bird_group}) %{_sysconfdir}/bird.conf %config(noreplace) %attr(0640,root,%{bird_group}) %{_sysconfdir}/bird.conf
%{_sbindir}/bird %{_sbindir}/bird
@ -159,24 +111,12 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf || true
%{_sbindir}/birdcl %{_sbindir}/birdcl
%{_sbindir}/rcbird %{_sbindir}/rcbird
%{_unitdir}/bird.service %{_unitdir}/bird.service
%files -n bird6
%config(noreplace) %attr(0640,root,%{bird_group}) %{_sysconfdir}/bird6.conf
%{_sbindir}/bird6
%{_sbindir}/birdc6
%{_sbindir}/birdcl6
%{_sbindir}/rcbird6
%{_unitdir}/bird6.service
%files common
%dir %attr(750,%{bird_user},%{bird_group}) %{bird_home} %dir %attr(750,%{bird_user},%{bird_group}) %{bird_home}
%{_tmpfilesdir}/%{name}.conf %{_tmpfilesdir}/%{name}.conf
%dir %attr(-,%{bird_user},%{bird_group}) %ghost %{bird_runtimedir} %dir %attr(-,%{bird_user},%{bird_group}) %ghost %{bird_runtimedir}
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/NEWS
%files doc %files doc
%doc %{_docdir}/%{name}/bird*.html %doc NEWS README
%doc doc/bird.conf.*
%changelog %changelog

View File

@ -1,17 +0,0 @@
[Unit]
Description=The BIRD Internet Routing Daemon (IPv6)
Documentation=http://bird.network.cz/doc/bird.html
Wants=network.target
After=network.target
ConditionFileIsExecutable=/usr/sbin/bird6
[Service]
Type=simple
ExecStartPre=/usr/sbin/bird6 -p -u bird -g bird
ExecStart=/usr/sbin/bird6 -u bird -g bird -f -P /run/bird/bird6.pid $BIRD_OPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
PIDFile=/run/bird/bird6.pid
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -1,32 +0,0 @@
Index: bird-1.6.3/proto/rip/packets.c
===================================================================
--- bird-1.6.3.orig/proto/rip/packets.c
+++ bird-1.6.3/proto/rip/packets.c
@@ -56,13 +56,20 @@ struct rip_block_auth
{
u16 must_be_ffff;
u16 auth_type;
- char password[0];
- u16 packet_len;
- u8 key_id;
- u8 auth_len;
- u32 seq_num;
- u32 unused1;
- u32 unused2;
+ /*
+ * use anonymous struct/union to get around a fortify source warnings about overwriting the password buffer
+ */
+ union {
+ char password[RIP_PASSWD_LENGTH];
+ struct {
+ u16 packet_len;
+ u8 key_id;
+ u8 auth_len;
+ u32 seq_num;
+ u32 unused1;
+ u32 unused2;
+ }
+ };
};
/* Authentication tail, RFC 4822 */

15
gcc10.patch Normal file
View File

@ -0,0 +1,15 @@
https://bird.network.cz/pipermail/bird-users/2020-February/014211.html
diff --git a/nest/route.h b/nest/route.h
index d2a07f09..b927db5f 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -458,7 +458,7 @@ typedef struct rta {
protocol-specific metric is availabe */
-const char * rta_dest_names[RTD_MAX];
+extern const char * rta_dest_names[RTD_MAX];
static inline const char *rta_dest_name(uint n)
{ return (n < RTD_MAX) ? rta_dest_names[n] : "???"; }