bird2: Bump to v2.0.4

Bird 2.0.4 was released on March 1st. Remove upstreamed patches.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
This commit is contained in:
Toke Høiland-Jørgensen 2019-01-14 09:47:10 +01:00 committed by Toke Høiland-Jørgensen
parent 29d4160f4b
commit 37f8c509e0
9 changed files with 3 additions and 377 deletions

View File

@ -7,12 +7,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bird2
PKG_VERSION:=2.0.2
PKG_VERSION:=2.0.4
PKG_RELEASE:=1
PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird
PKG_HASH:=035f91d6f568f8ed438a0814235ac4c5c79147cd2acf201322c307732883480f
PKG_HASH:=676010b7517d4159b9af37401c26185f561ffcffeba73690a2ef2fad984714de
PKG_BUILD_DEPENDS:=ncurses readline
PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION)

View File

@ -1,29 +0,0 @@
From f3a8cf050e6181e158dcde2fe885d7bf220eedc3 Mon Sep 17 00:00:00 2001
From: "Ondrej Zajicek (work)" <santiago@crfreenet.org>
Date: Thu, 12 Apr 2018 16:55:56 +0200
Subject: [PATCH] BGP: Fix extended next hop handling
For IPv4 with extended next hop, we use MP-BGP format and therefore no
independent NEXT_HOP attribute.
Thanks to Arvin Gan for the bugreport.
---
proto/bgp/attrs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 0f41f818..9003feb2 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -295,7 +295,7 @@ bgp_encode_next_hop(struct bgp_write_state *s, eattr *a, byte *buf, uint size)
* store it and encode it later by AFI-specific hooks.
*/
- if (s->channel->afi == BGP_AF_IPV4)
+ if ((s->channel->afi == BGP_AF_IPV4) && !s->channel->ext_next_hop)
{
ASSERT(a->u.ptr->length == sizeof(ip_addr));
--
2.17.0

View File

@ -29,7 +29,7 @@ index ce05191c..afd2eb19 100644
+ * makes it possible to, e.g., assign /32 addresses on a mesh interface and
+ * have routing work.
+ */
+ if (!neigh_find2(&p->p, &r->next_hop, r->neigh->ifa->iface, 0))
+ if (!neigh_find(&p->p, r->next_hop, r->neigh->ifa->iface, 0))
+ a0.nh.flags = RNF_ONLINK;
+
rta *a = rta_lookup(&a0);

View File

@ -1,37 +0,0 @@
From 823ad12191e66e243dd088a81c66e4a518563e40 Mon Sep 17 00:00:00 2001
From: Jan Maria Matejka <mq@ucw.cz>
Date: Fri, 27 Apr 2018 14:38:41 +0200
Subject: [PATCH] Filter: Added missing instruction comparators.
These instructions caused SIGABORTs on reconfiguration.
---
filter/filter.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/filter/filter.c b/filter/filter.c
index bb3146e7..881ba420 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -1712,7 +1712,10 @@ i_same(struct f_inst *f1, struct f_inst *f2)
case FI_EA_SET: ONEARG; A2_SAME; break;
case FI_RETURN: ONEARG; break;
+ case FI_ROA_MAXLEN: ONEARG; break;
+ case FI_ROA_ASN: ONEARG; break;
case FI_IP: ONEARG; break;
+ case FI_IS_V4: ONEARG; break;
case FI_ROUTE_DISTINGUISHER: ONEARG; break;
case FI_CALL: /* Call rewriting trickery to avoid exponential behaviour */
ONEARG;
@@ -1735,6 +1738,8 @@ i_same(struct f_inst *f1, struct f_inst *f2)
((struct f_inst_roa_check *) f2)->rtc->name))
return 0;
break;
+ case FI_FORMAT: ONEARG; break;
+ case FI_ASSERT: ONEARG; break;
default:
bug( "Unknown instruction %d in same (%c)", f1->fi_code, f1->fi_code & 0xff);
}
--
2.17.0

View File

@ -1,33 +0,0 @@
From 40e7bd0e39849a03bd3f6f44d6719a5f8b1dd291 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
Date: Mon, 30 Apr 2018 16:29:20 +0200
Subject: [PATCH] babel: Fix type of route entry router ID
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The router ID being assigned to routes was a uint, which discards the upper
32 bits. This also has the nice side effect of echoing the wrong router ID
back to other routers.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
---
proto/babel/babel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 4fd88042..a8eb5ea8 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -2140,7 +2140,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net,
uint internal = (new->attrs->src->proto == P);
uint rt_seqno = internal ? new->u.babel.seqno : p->update_seqno;
uint rt_metric = ea_get_int(attrs, EA_BABEL_METRIC, 0);
- uint rt_router_id = internal ? new->u.babel.router_id : p->router_id;
+ u64 rt_router_id = internal ? new->u.babel.router_id : p->router_id;
if (rt_metric > BABEL_INFINITY)
{
--
2.17.0

View File

@ -1,118 +0,0 @@
From 70fab17837dbb4c5848681e4c6b9b90891891130 Mon Sep 17 00:00:00 2001
From: "Ondrej Zajicek (work)" <santiago@crfreenet.org>
Date: Thu, 3 May 2018 16:55:11 +0200
Subject: [PATCH 1/2] Babel: Add option to randomize router ID
When a Babel node restarts, it loses its sequence number, which can cause
its routes to be rejected by peers until the state is cleared out by other
nodes in the network (which can take on the order of minutes).
There are two ways to fix this: Having stable storage to keep the sequence
number across restarts, or picking a different router ID each time.
This implements the latter, by introducing a new option that will cause
BIRD to randomize a high 32 bits of router ID every time it starts up.
This avoids the problem at the cost of not having stable router IDs in
the network.
Thanks to Toke Hoiland-Jorgensen for the patch.
---
doc/bird.sgml | 10 ++++++++++
proto/babel/babel.c | 11 +++++++++++
proto/babel/babel.h | 1 +
proto/babel/config.Y | 3 ++-
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/doc/bird.sgml b/doc/bird.sgml
index 1191fa03..ae308d4c 100644
--- a/doc/bird.sgml
+++ b/doc/bird.sgml
@@ -1691,6 +1691,7 @@ supports the following per-interface configuration options:
protocol babel [<name>] {
ipv4 { <channel config> };
ipv6 [sadr] { <channel config> };
+ randomize router id <switch>;
interface <interface pattern> {
type <wired|wireless>;
rxcost <number>;
@@ -1713,6 +1714,15 @@ protocol babel [<name>] {
<tag><label id="babel-channel">ipv4 | ipv6 [sadr] <m/channel config/</tag>
The supported channels are IPv4, IPv6, and IPv6 SADR.
+ <tag><label id="babel-random-router-id">randomize router id <m/switch/</tag>
+ If enabled, Bird will randomize the top 32 bits of its router ID whenever
+ the protocol instance starts up. If a Babel node restarts, it loses its
+ sequence number, which can cause its routes to be rejected by peers until
+ the state is cleared out by other nodes in the network (which can take on
+ the order of minutes). Enabling this option causes Bird to pick a random
+ router ID every time it starts up, which avoids this problem at the cost
+ of not having stable router IDs in the network. Default: no.
+
<tag><label id="babel-type">type wired|wireless </tag>
This option specifies the interface type: Wired or wireless. On wired
interfaces a neighbor is considered unreachable after a small number of
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 797a83d4..ce05191c 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -2226,6 +2226,14 @@ babel_init(struct proto_config *CF)
return P;
}
+static inline void
+babel_randomize_router_id(struct babel_proto *p)
+{
+ p->router_id &= (u64) 0xffffffff;
+ p->router_id |= ((u64) random()) << 32;
+ TRACE(D_EVENTS, "Randomized router ID to %lR", p->router_id);
+}
+
static int
babel_start(struct proto *P)
{
@@ -2244,6 +2252,9 @@ babel_start(struct proto *P)
p->update_seqno = 1;
p->router_id = proto_get_router_id(&cf->c);
+ if (cf->randomize_router_id)
+ babel_randomize_router_id(p);
+
p->route_slab = sl_new(P->pool, sizeof(struct babel_route));
p->source_slab = sl_new(P->pool, sizeof(struct babel_source));
p->msg_slab = sl_new(P->pool, sizeof(struct babel_msg_node));
diff --git a/proto/babel/babel.h b/proto/babel/babel.h
index b194ce30..e5c9cd5b 100644
--- a/proto/babel/babel.h
+++ b/proto/babel/babel.h
@@ -112,6 +112,7 @@ struct babel_config {
struct proto_config c;
list iface_list; /* List of iface configs (struct babel_iface_config) */
uint hold_time; /* Time to hold stale entries and unreachable routes */
+ u8 randomize_router_id;
struct channel_config *ip4_channel;
struct channel_config *ip6_channel;
diff --git a/proto/babel/config.Y b/proto/babel/config.Y
index 7adfb4bb..205b4e4f 100644
--- a/proto/babel/config.Y
+++ b/proto/babel/config.Y
@@ -25,7 +25,7 @@ CF_DECLS
CF_KEYWORDS(BABEL, INTERFACE, METRIC, RXCOST, HELLO, UPDATE, INTERVAL, PORT,
TYPE, WIRED, WIRELESS, RX, TX, BUFFER, PRIORITY, LENGTH, CHECK, LINK,
NEXT, HOP, IPV4, IPV6, BABEL_METRIC, SHOW, INTERFACES, NEIGHBORS,
- ENTRIES)
+ ENTRIES, RANDOMIZE, ROUTER, ID)
CF_GRAMMAR
@@ -42,6 +42,7 @@ babel_proto_item:
proto_item
| proto_channel
| INTERFACE babel_iface
+ | RANDOMIZE ROUTER ID bool { BABEL_CFG->randomize_router_id = $4; }
;
babel_proto_opts:
--
2.17.0

View File

@ -1,30 +0,0 @@
From eaf63d314d50cba5b2cfa8f18de64a91d3131b94 Mon Sep 17 00:00:00 2001
From: "Ondrej Zajicek (work)" <santiago@crfreenet.org>
Date: Thu, 3 May 2018 17:07:39 +0200
Subject: [PATCH 2/2] Better initialization of random generator
Use full time precision to initialize random generator. The old
code was prone to initialize it to the same values in specific
circumstances (boot without RTC, multiple VMs starting at once).
---
sysdep/unix/io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 012deaf0..11a0d6f1 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -2144,7 +2144,9 @@ io_init(void)
// XXX init_times();
// XXX update_times();
boot_time = current_time();
- srandom((uint) (current_real_time() TO_S));
+
+ u64 now = (u64) current_real_time();
+ srandom((uint) (now ^ (now >> 32)));
}
static int short_loops = 0;
--
2.17.0

View File

@ -1,28 +0,0 @@
diff --git a/Makefile.in b/Makefile.in
index c8168bb..eb6cc5c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,11 +21,6 @@ INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
-git-label:=$(strip $(shell git describe --always --dirty=-x 2>/dev/null))
-ifneq ($(git-label),)
- CFLAGS += -DGIT_LABEL="$(git-label)"
-endif
-
client=$(addprefix $(exedir)/,@CLIENT@)
daemon=$(exedir)/bird
protocols=@protocols@
@@ -42,6 +37,11 @@ srcdir := @srcdir@
objdir := @objdir@
exedir := @exedir@
+git-label:=$(strip $(shell cd $(srcdir) && [ "$$(git rev-parse --show-toplevel)" = "$$(readlink -f .)" ] && git describe --always --dirty=-x 2>/dev/null))
+ifneq ($(git-label),)
+ CFLAGS += -DGIT_LABEL="$(git-label)"
+endif
+
ifeq ($(objdir),.)
objdir := $(realpath .)
endif

View File

@ -1,99 +0,0 @@
From b24b781117179f301116837f0a39468343e4805b Mon Sep 17 00:00:00 2001
From: "Ondrej Zajicek (work)" <santiago@crfreenet.org>
Date: Wed, 16 May 2018 11:19:29 +0200
Subject: [PATCH] Filter: Add support for src filter op to access SADR source
prefix
The patch allows to use 'net.src' to access SADR source prefix
from filters.
Thanks to Toke Hoiland-Jorgensen for the original patch for srclen.
---
filter/config.Y | 3 ++-
filter/filter.c | 15 +++++++++++++++
filter/filter.h | 1 +
lib/net.h | 2 ++
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/filter/config.Y b/filter/config.Y
index f8170a83..e01e02ef 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -411,7 +411,7 @@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
TRUE, FALSE, RT, RO, UNKNOWN, GENERIC,
FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX,
PREFERENCE,
- ROA_CHECK, ASN,
+ ROA_CHECK, ASN, SRC,
IS_V4, IS_V6,
LEN, MAXLEN,
DEFINED,
@@ -898,6 +898,7 @@ term:
| term '.' LEN { $$ = f_new_inst(FI_LENGTH); $$->a1.p = $1; }
| term '.' MAXLEN { $$ = f_new_inst(FI_ROA_MAXLEN); $$->a1.p = $1; }
| term '.' ASN { $$ = f_new_inst(FI_ROA_ASN); $$->a1.p = $1; }
+ | term '.' SRC { $$ = f_new_inst(FI_SADR_SRC); $$->a1.p = $1; }
| term '.' MASK '(' term ')' { $$ = f_new_inst(FI_IP_MASK); $$->a1.p = $1; $$->a2.p = $5; }
| term '.' FIRST { $$ = f_new_inst(FI_AS_PATH_FIRST); $$->a1.p = $1; }
| term '.' LAST { $$ = f_new_inst(FI_AS_PATH_LAST); $$->a1.p = $1; }
diff --git a/filter/filter.c b/filter/filter.c
index 881ba420..3d7b5c9f 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -1241,6 +1241,20 @@ interpret(struct f_inst *what)
default: runtime( "Prefix, path, clist or eclist expected" );
}
break;
+ case FI_SADR_SRC: /* Get SADR src prefix */
+ ONEARG;
+ if (v1.type != T_NET || !net_is_sadr(v1.val.net))
+ runtime( "SADR expected" );
+
+ {
+ net_addr_ip6_sadr *net = (void *) v1.val.net;
+ net_addr *src = lp_alloc(f_pool, sizeof(net_addr_ip6));
+ net_fill_ip6(src, net->src_prefix, net->src_pxlen);
+
+ res.type = T_NET;
+ res.val.net = src;
+ }
+ break;
case FI_ROA_MAXLEN: /* Get ROA max prefix length */
ONEARG;
if (v1.type != T_NET || !net_is_roa(v1.val.net))
@@ -1714,6 +1728,7 @@ i_same(struct f_inst *f1, struct f_inst *f2)
case FI_RETURN: ONEARG; break;
case FI_ROA_MAXLEN: ONEARG; break;
case FI_ROA_ASN: ONEARG; break;
+ case FI_SADR_SRC: ONEARG; break;
case FI_IP: ONEARG; break;
case FI_IS_V4: ONEARG; break;
case FI_ROUTE_DISTINGUISHER: ONEARG; break;
diff --git a/filter/filter.h b/filter/filter.h
index d347924a..982276f0 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -55,6 +55,7 @@
F(FI_LENGTH, 0, 'L') \
F(FI_ROA_MAXLEN, 'R', 'M') \
F(FI_ROA_ASN, 'R', 'A') \
+ F(FI_SADR_SRC, 'n', 's') \
F(FI_IP, 'c', 'p') \
F(FI_ROUTE_DISTINGUISHER, 'R', 'D') \
F(FI_AS_PATH_FIRST, 'a', 'f') \
diff --git a/lib/net.h b/lib/net.h
index ad4000fd..0cd5f735 100644
--- a/lib/net.h
+++ b/lib/net.h
@@ -268,6 +268,8 @@ static inline int net_is_roa(const net_addr *a)
static inline int net_is_flow(const net_addr *a)
{ return (a->type == NET_FLOW4) || (a->type == NET_FLOW6); }
+static inline int net_is_sadr(const net_addr *a)
+{ return (a->type == NET_IP6_SADR); }
static inline ip4_addr net4_prefix(const net_addr *a)
{ return ((net_addr_ip4 *) a)->prefix; }
--
2.17.0