Merge pull request #378 from tohojo/bird-2.0
[feed/routing.git] / bird2 / patches / 0001-BGP-Fix-extended-next-hop-handling.patch
1 From f3a8cf050e6181e158dcde2fe885d7bf220eedc3 Mon Sep 17 00:00:00 2001
2 From: "Ondrej Zajicek (work)" <santiago@crfreenet.org>
3 Date: Thu, 12 Apr 2018 16:55:56 +0200
4 Subject: [PATCH] BGP: Fix extended next hop handling
5
6 For IPv4 with extended next hop, we use MP-BGP format and therefore no
7 independent NEXT_HOP attribute.
8
9 Thanks to Arvin Gan for the bugreport.
10 ---
11 proto/bgp/attrs.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14 diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
15 index 0f41f818..9003feb2 100644
16 --- a/proto/bgp/attrs.c
17 +++ b/proto/bgp/attrs.c
18 @@ -295,7 +295,7 @@ bgp_encode_next_hop(struct bgp_write_state *s, eattr *a, byte *buf, uint size)
19 * store it and encode it later by AFI-specific hooks.
20 */
21
22 - if (s->channel->afi == BGP_AF_IPV4)
23 + if ((s->channel->afi == BGP_AF_IPV4) && !s->channel->ext_next_hop)
24 {
25 ASSERT(a->u.ptr->length == sizeof(ip_addr));
26
27 --
28 2.17.0
29