bird2: Bump to v2.0.4
[feed/routing.git] / bird2 / patches / 0001-babel-Set-onlink-flag-for-IPv4-routes-with-unreachab.patch
1 From 0ca3156f64a46c52c6d6fc913958f83970d3e57f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
3 Date: Mon, 30 Apr 2018 11:13:02 +0200
4 Subject: [PATCH] babel: Set onlink flag for IPv4 routes with unreachable next
5 hop
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 If the next hop of a route is not a reachable address, the route should be
11 installed as onlink. This enables a configuration common in mesh networks
12 where the mesh interface is assigned a /32 and babel handles the routing by
13 installing onlink routes.
14
15 Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
16 ---
17 proto/babel/babel.c | 7 +++++++
18 1 file changed, 7 insertions(+)
19
20 diff --git a/proto/babel/babel.c b/proto/babel/babel.c
21 index ce05191c..afd2eb19 100644
22 --- a/proto/babel/babel.c
23 +++ b/proto/babel/babel.c
24 @@ -640,6 +640,13 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
25 .nh.iface = r->neigh->ifa->iface,
26 };
27
28 + /* If we cannot find a reachable neighbour, set the entry to be onlink. This
29 + * makes it possible to, e.g., assign /32 addresses on a mesh interface and
30 + * have routing work.
31 + */
32 + if (!neigh_find(&p->p, r->next_hop, r->neigh->ifa->iface, 0))
33 + a0.nh.flags = RNF_ONLINK;
34 +
35 rta *a = rta_lookup(&a0);
36 rte *rte = rte_get_temp(a);
37 rte->u.babel.seqno = r->seqno;
38 --
39 2.17.0
40