summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-11-07 10:24:56 +0100
committerMaria Matejka <mq@ucw.cz>2022-11-07 10:24:56 +0100
commit54179a1ab38542e7087db37bfe3de9d32886c78e (patch)
treeca4238a2046bd5b6be90dab52b5b0cd3ab8663c0 /proto/bgp/packets.c
parent96d380405701bb01d792ff1c867a607d7fefa001 (diff)
parent8f79e6b93e32a4eb7e4dda9bd4a9d04400b79d45 (diff)
Merge commit '8f79e6b9' into thread-next
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index f9c1da41..506268c9 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1028,13 +1028,15 @@ bgp_apply_next_hop(struct bgp_parse_state *s, ea_list **to, ip_addr gw, ip_addr
WITHDRAW(BAD_NEXT_HOP " - zero address");
rtable *tab = ipa_is_ip4(gw) ? c->igp_table_ip4 : c->igp_table_ip6;
+ ip_addr lla = (c->cf->next_hop_prefer == NHP_LOCAL) ? ll : IPA_NONE;
+
if (s->mpls)
{
u32 labels[BGP_MPLS_MAX];
- ea_set_hostentry(to, c->c.table, tab, gw, ll, BGP_MPLS_MAX, labels);
+ ea_set_hostentry(to, c->c.table, tab, gw, lla, BGP_MPLS_MAX, labels);
}
else
- ea_set_hostentry(to, c->c.table, tab, gw, ll, 0, NULL);
+ ea_set_hostentry(to, c->c.table, tab, gw, lla, 0, NULL);
}
}