summaryrefslogtreecommitdiffstats
path: root/proto/bgp
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/attrs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 585bfd1..8a849e7 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -788,8 +788,8 @@ bgp_create_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p
z = bgp_set_attr_wa(ea->attrs+2, pool, BA_NEXT_HOP, NEXT_HOP_LENGTH);
if (p->cf->next_hop_self ||
- !p->is_internal ||
- rta->dest != RTD_ROUTER)
+ rta->dest != RTD_ROUTER ||
+ (!p->is_internal && (e->attrs->iface != p->neigh->iface)))
set_next_hop(z, p->source_addr);
else
set_next_hop(z, e->attrs->gw);