diff options
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r-- | proto/bgp/packets.c | 6 |
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); } } |